home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / bindings / emacs.keys < prev    next >
Encoding:
Text File  |  1996-09-27  |  71.6 KB  |  2,992 lines

  1. ;OCL{{{}}}
  2. ;OCL{{{  Notes
  3. ; These bindings are my personal favourite Origami bindings for daily
  4. ; work. You will feel like in Emacs, although many functions work
  5. ; different, the cursor lands not always where is lands in Emacs and other
  6. ; things.
  7. ;
  8. ; There is some experimental stuff for writing C programs, which will be
  9. ; enabled by C-mode.  My idea is to have an editor which saves me from
  10. ; typing bothering things, which supports a few aspects of C syntax but
  11. ; does not restrict me like a syntax-controlled editor does.  If you have
  12. ; any ideas what could be useful for these bindings, write me mail.
  13. ;
  14. ; In fact, I like these keybindings more than real Emacs, especially on
  15. ; machines where an Meta key (which sends escape plus character) is available!
  16. ;
  17. ; Many people wished these bindings not be called "Emacs" in the
  18. ; statusline.  True, this is not what is known as Emacs.  It is EMacs!
  19. ;
  20. ; Michael Haardt
  21. ;OCL}}}
  22.  
  23. ;OCL{{{  get terminal-data
  24. @lib emacs-fun/em-term-alias
  25. ;OCL}}}
  26.  
  27. ;OCL{{{  name and command line options
  28. ( defbinding EMacs
  29.   ( "default ">0=0 )
  30.   ( "notime  ">0|64 )   ( "time      ">0|64^64 )
  31.   ( "noai    ">0|32 )   ( "ai        ">0|32^32 )
  32.   ( "magic   ">0|8  )   ( "xmagic    ">0|16    ) ( "nomagic ">0|24^24 )
  33.   ( "posi    ">0|4 )    ( "noposi    ">0|4^4   )
  34.   ( "c       ">0|2 )    ( "noc       ">0|2^2   )
  35.   ( "full    ">0|1 )    ( "nofull    ">0|1^1   )
  36. )
  37. ;OCL}}}
  38.  
  39. ;OCL{{{  character-classes
  40. (defset text-word-char (alpha digit))
  41. (defset c-word-char (alpha digit "_))
  42.  
  43. (defset word-char (text-word-char))
  44. ;OCL}}}
  45.  
  46. ;OCL{{{  keytables
  47. ( defmodes ( edit para ) )
  48. ;OCL}}}
  49. ;OCL{{{  keyboard hooks
  50. ( defvar ( prompting ) )
  51. ;OCL{{{  begin-prompt
  52. ( deffun begin-prompt ( if prompting ( para ) fi ))
  53. ;OCL}}}
  54. ;OCL{{{  end-prompt
  55. ( deffun end-prompt ( edit ))
  56. ;OCL}}}
  57. (begin-prompt-macro begin-prompt)
  58. (end-prompt-macro end-prompt)
  59. ;OCL}}}
  60.  
  61. ;OCL{{{  code for not builtin commands
  62. ;OCL{{{  variables
  63. ( defvar ( push-noparse ) )
  64. ;OCL}}}
  65. ;OCL{{{  @use for libraries
  66. @use
  67.  ( FORCE-DOT-SPACES ; fill-paragraph should always use '  ' after '.'
  68.  )
  69. ;OCL}}}
  70. ( overload-prefix ( emori- ) )
  71. ;OCL{{{  set-display-mode ; not staying in loop
  72. ( defmac set-display-mode- ( set-display-mode ) )
  73. ( undeclare ( set-display-mode ) )
  74. ( deffun set-display-mode
  75.    ( local
  76.       ( modify-behaviour )
  77.       ( set modify-behaviour 1
  78.         set-display-mode-
  79.       )
  80.    )
  81. )
  82. ( undeclare ( set-display-mode- ) )
  83. ;OCL}}}
  84. ;OCL{{{  help
  85. @use ( REF-TREE EMacs-Reference-Card-REF EMacs-Reference-Card-TREE )
  86. @lib emacs-fun/ref.ocl
  87. @use not( REF-TREE EMacs-Reference-Card-REF EMacs-Reference-Card-TREE )
  88. ( deffun emori-help
  89.    ( if last-message M_ANY_Q ( ) fi
  90.      screen-off
  91.      help
  92.      screen-on
  93.      case
  94.       ( last-message M_ANY_Q ( insert-ascii ref-call-i-back ) )
  95.      default
  96.       ( newline-and-indent
  97.         set prompting true
  98.         EMacs-Reference-Card
  99.         set prompting false
  100.       )
  101.      esac
  102.    )
  103. )
  104. ;OCL}}}
  105. ;OCL{{{  error-buff
  106. @lib error-buff
  107. ( deffun emori-open-error-buffer
  108.    ( if read-repeat () fi
  109.      set prompting true
  110.      open-error-buffer
  111.      set prompting false
  112.    )
  113. )
  114. ;OCL}}}
  115. ;OCL{{{  prefix-noparse functions
  116. ;OCL{{{  check-buff-arg
  117. ( deffun check-buff-arg
  118.    ( if >(read-repeat 0)
  119.       ( add-mode-no-parse
  120.         if ocl-argument
  121.          ( set push-noparse current-buffer-number )
  122.         fi
  123.       )
  124.      fi
  125.    )
  126. )
  127. ;OCL}}}
  128. ;OCL{{{  reset-pushed-noparse
  129. ( deffun reset-pushed-noparse
  130.    ( case
  131.       ( =(push-noparse 0) ( return-from-macro ) )
  132.       ( =(push-noparse -(current-buffer-number 1))
  133.         ;OCL{{{  restore last and current
  134.         ( screen-off
  135.           save-buffer-layout
  136.           goto-buffer-number push-noparse
  137.           delete-mode-no-parse
  138.           goto-buffer-number +(push-noparse 1)
  139.           restore-buffer-layout
  140.           delete-mode-no-parse
  141.           screen-on
  142.           redraw-display
  143.         )
  144.         ;OCL}}}
  145.       )
  146.       ( =(push-noparse current-buffer-number)
  147.         ;OCL{{{  restore current
  148.         ( delete-mode-no-parse )
  149.         ;OCL}}}
  150.       )
  151.      esac
  152.      set push-noparse 0
  153.    )
  154. )
  155. ;OCL}}}
  156.  
  157. ( deffun emori-open-buffer ( check-buff-arg open-buffer ) )
  158. ( deffun emori-open-adjacent-buffer ( check-buff-arg open-adjacent-buffer ) )
  159. ( deffun emori-read-file ( check-buff-arg read-file ) )
  160.  
  161. ( undeclare ( check-buff-arg ) )
  162. ;OCL}}}
  163. @lib np-file
  164. @lib delchar
  165. @lib overwdel
  166. @lib error
  167. @lib next-char
  168. @lib pre-char
  169. @lib skippara
  170. ;OCL{{{  fill-para
  171. @lib fillpara
  172. ;OCL{{{  emori-set-fill-column
  173. ( deffun emori-set-fill-column
  174.    ( set prompting true
  175.      set-fill-column
  176.      set prompting false
  177.    )
  178. )
  179. ;OCL}}}
  180. ;OCL}}}
  181. @lib go-match
  182. @lib trans-char
  183. @lib wordmacs
  184. @lib buff-chg
  185. ;OCL{{{  listbuff
  186. @lib listbuff
  187. ( deffun emori-list-buffers
  188.    ( set prompting true
  189.      list-buffers
  190.      set prompting false
  191.    )
  192. )
  193. ;OCL}}}
  194. @lib buff-size
  195. ;OCL{{{  tags
  196. @use ( E-G-T-BUFF F-G-T-BUFF S-U-T-FILE T-COMP )
  197. @lib tags-mac
  198. ;OCL{{{  emori-enter-and-go-tags-buffer
  199. ( deffun emori-enter-and-go-tags-buffer
  200.    ( set prompting true
  201.      enter-and-go-tags-buffer
  202.      set prompting false
  203.    )
  204. )
  205. ;OCL}}}
  206. ;OCL{{{  emori-find-and-go-tags-buffer
  207. ( deffun emori-find-and-go-tags-buffer
  208.    ( set prompting true
  209.      find-and-go-tags-buffer
  210.      set prompting false
  211.    )
  212. )
  213. ;OCL}}}
  214. ;OCL{{{  emori-set-user-tags-file
  215. ( deffun emori-set-user-tags-file
  216.    ( set prompting true
  217.      set-user-tags-file
  218.      set prompting false
  219.    )
  220. )
  221. ;OCL}}}
  222. @use not( E-G-T-BUFF F-G-T-BUFF S-U-T-FILE T-COMP )
  223. ;OCL}}}
  224. @lib filetagc
  225. ;OCL{{{  emori-enter-fold
  226. @lib search-enter
  227. ( defmac emori-enter-fold ( search-and-enter-fold ) )
  228. ;OCL}}}
  229. ;OCL{{{  exit
  230. @lib exit
  231. ;OCL{{{  emori-exit-origami
  232. ( deffun emori-exit-origami
  233.    ( if not(in-prompt)
  234.       ( set prompting true
  235.         exit-origami
  236.         set prompting false
  237.       )
  238.      fi
  239.    )
  240. )
  241. ;OCL}}}
  242. ( undeclare ( exit-origami ) )
  243. ;OCL}}}
  244. ;OCL{{{  motion
  245. ;OCL{{{  backward-sentence
  246. ( defvar ( point-not-found ) )
  247. ( deffun backward-sentence
  248.    ( if not(test-text) ( failed ) fi
  249.      set point-not-found 1
  250.      ;OCL{{{  search '.  '
  251.      do
  252.       ( do
  253.          ;OCL{{{  skip char and roff-comment
  254.          ( previous-text-character
  255.            if test-top ( failed ) fi
  256.            if and(test-char ". test-begin-line)
  257.             ( previous-text-character )
  258.            fi
  259.            if not(or(test-char-set space test-char ". ))
  260.             ( set point-not-found 0 )
  261.            fi
  262.          )
  263.          ;OCL}}}
  264.         while or(point-not-found not(test-char ". ))
  265.         forward-character
  266.         if test-char-set space
  267.          ( forward-character
  268.            if not(test-char-set space )
  269.             ( backward-character
  270.               backward-character
  271.             )
  272.            fi
  273.          )
  274.         else
  275.          ( backward-character
  276.          )
  277.         fi
  278.       )
  279.      while not(test-char-set space )
  280.      ;OCL}}}
  281.      while or(test-char-set space and(test-char ". test-begin-line))
  282.       ( if and(test-char ". test-begin-line) ( end-of-line ) fi
  283.         forward-text-character
  284.         if test-bottom ( failed ) fi
  285.       )
  286.    )
  287. )
  288. ( undeclare ( point-not-found ) )
  289. ;OCL}}}
  290. ;OCL{{{  forward-sentence
  291. ( deffun forward-sentence
  292.    ( if not(test-text) ( failed ) fi
  293.      ;OCL{{{  search ".  "
  294.      do
  295.       (
  296.         ;OCL{{{  search the next .
  297.         do
  298.          ( if test-char ".
  299.             ( next-line
  300.               beginning-of-line
  301.             )
  302.            else
  303.             ( do
  304.                ( if test-bottom ( failed ) fi
  305.                  forward-text-character
  306.                )
  307.               while not(test-char ".)
  308.             )
  309.            fi
  310.          )
  311.         while test-begin-line
  312.         ;OCL}}}
  313.         forward-character
  314.         if test-char-set space ( forward-character ) fi
  315.       )
  316.      while not(test-char-set space )
  317.      ;OCL}}}
  318.      ;OCL{{{  move to following non-space-char
  319.      while or(test-char-set space and(test-char ". test-begin-line))
  320.       ( if and(test-char ". test-begin-line) ( end-of-line ) fi
  321.         forward-text-character
  322.         if test-bottom ( failed ) fi
  323.       )
  324.      ;OCL}}}
  325.    )
  326. )
  327. ;OCL}}}
  328. ;OCL{{{  go-to-line
  329. (defvar (ln))
  330.  
  331. (deffun go-to-line
  332. (
  333.   set ln read-repeat
  334.   if >(ln 0) (goto-line-counter ln)
  335.   else (goto-line) fi
  336. ))
  337. ;OCL}}}
  338. ;OCL}}}
  339. ;OCL{{{  editing
  340. ;OCL{{{  mode autoindent
  341. ;OCL{{{  variables
  342. ( defvar ( no-auto-indent ) )
  343. ;OCL}}}
  344. ;OCL{{{  modestrings
  345. ( defmodestring AI "Autoindent "Ai )
  346. ( deffun update-ai-statline
  347.    ( if no-auto-indent
  348.       ( reset-user-mode AI )
  349.      else
  350.       ( set-user-mode AI ) fi
  351.    )
  352. )
  353. ;OCL}}}
  354. ;OCL{{{  add-mode-autoindent
  355. ( deffun add-mode-autoindent ( set no-auto-indent false update-ai-statline ) )
  356. ;OCL}}}
  357. ;OCL{{{  delete-mode-autoindent
  358. ( deffun delete-mode-autoindent ( set no-auto-indent true update-ai-statline ) )
  359. ;OCL}}}
  360. ;OCL}}}
  361. ;OCL{{{  emori-newline-and-indent
  362. @lib delspaces
  363. ( deffun emori-newline-and-indent
  364.    ( if or(in-prompt not(no-auto-indent) not(test-text))
  365.       ( newline-and-indent )
  366.      else
  367.       ( newline-and-indent
  368.         "$
  369.         goto-counter 1
  370.         delspaces
  371.         delete-character
  372.       )
  373.      fi
  374.    )
  375. )
  376. ;OCL}}}
  377. ;OCL{{{  delete-word-backward
  378. (deffun delete-word-backward
  379. (
  380.   ;OCL{{{  go back one character in text
  381.   if test-begin-line
  382.   (
  383.     if test-top ( return-from-macro ) fi
  384.     previous-line
  385.     end-of-line
  386.   )
  387.   else
  388.   (
  389.     backward-character
  390.   ) fi
  391.   ;OCL}}}
  392.   ;OCL{{{  delete white space
  393.   while not(test-char-set word-char)
  394.   (
  395.     if test-begin-line
  396.     (
  397.       if test-top ( return-from-macro ) fi
  398.       previous-line end-of-line
  399.     )
  400.     else
  401.     (
  402.       delete-character
  403.       backward-character
  404.     )
  405.     fi
  406.   )
  407.   ;OCL}}}
  408.   ;OCL{{{  delete word
  409.   while test-char-set word-char
  410.   (
  411.     delete-character
  412.     if test-begin-line (return-from-macro) fi
  413.     backward-character
  414.   )
  415.   ;OCL}}}
  416.   ;OCL{{{  move forward to beginning of word
  417.   forward-character
  418.   ;OCL}}}
  419. ))
  420. ;OCL}}}
  421. ;OCL{{{  delete-word
  422. (deffun delete-word
  423. (
  424.   ; perhaps I should better fill up to the previous x position
  425.   if test-end-line (delete-character " ) fi
  426.   ;OCL{{{  delete word
  427.   while and(test-text test-char-set word-char)
  428.   (
  429.     if test-end-line (return-from-macro)
  430.     else (delete-character) fi
  431.   )
  432.   ;OCL}}}
  433.   ;OCL{{{  delete white space
  434.   while and(test-text not(test-char-set word-char))
  435.   (
  436.     if test-end-line (return-from-macro)
  437.     else (delete-character) fi
  438.   )
  439.   ;OCL}}}
  440. ))
  441. ;OCL}}}
  442. ;OCL}}}
  443. ;OCL{{{  c-mode
  444. (defvar (c-mode))
  445. ;OCL{{{  add/delete c-mode
  446. (defmodestring CM "C-mode "C )
  447. ;OCL{{{  add-mode-c
  448. (deffun add-mode-c
  449. (
  450.   if not(in-prompt)
  451.   (
  452.     set c-mode 1
  453.     set-user-mode CM
  454.     defset word-char c-word-char
  455.   )
  456.   fi
  457. ))
  458. ;OCL}}}
  459. ;OCL{{{  delete-mode-wrap
  460. (deffun delete-mode-c
  461. (
  462.   if not(in-prompt)
  463.   (
  464.     set c-mode 0
  465.     reset-user-mode CM
  466.     defset word-char text-word-char
  467.   )
  468.   fi
  469. ))
  470. ;OCL}}}
  471. ;OCL}}}
  472. ;OCL{{{  paired-parens
  473. (deffun paired-parens (
  474.   "(
  475.   if and(>(c-mode 0) not(in-prompt))
  476.   (
  477.     ")
  478.     backward-character
  479.   )
  480.   fi
  481. ))
  482. ;OCL}}}
  483. ;OCL{{{  paired-brackets
  484. (deffun paired-brackets
  485. (
  486.   "[
  487.  
  488.   if and(>(c-mode 0) not(in-prompt))
  489.   (
  490.     "]
  491.     backward-character
  492.   )
  493.   fi
  494. ))
  495. ;OCL}}}
  496. ;OCL{{{  paired-curly-brackets
  497. ( defvar ( x_pos_cb ) )
  498. (deffun paired-curly-brackets
  499. (
  500.   if or(in-prompt,not(test-text),<=(c-mode 0))
  501.   (
  502.     "{
  503.   )
  504.   else
  505.   (
  506.     ;OCL{{{  handle begin/end-fold/fold/prompt
  507.     case
  508.       (or(test-begin-fold,test-top)  (end-of-line newline-and-indent))
  509.       (or(test-end-fold,test-bottom) (beginning-of-line newline-and-indent previous-line))
  510.     esac
  511.     ;OCL}}}
  512.     ;OCL{{{  correct position?
  513.     set x_pos_cb store-pos
  514.     beginning-of-line
  515.     if test-char "  (
  516.       goto-counter x_pos_cb
  517.     ) else (
  518.       end-of-line
  519.       newline-and-indent
  520.     ) fi
  521.     ;OCL}}}
  522.     "{ newline-and-indent "}
  523.     previous-line
  524.     end-of-line
  525.     newline-and-indent
  526.     forward-character forward-character
  527.   )
  528.   fi
  529. ))
  530. ;OCL}}}
  531. ;OCL{{{  paired-doublequotes
  532. (deffun paired-doublequotes
  533. (
  534.   ""
  535.   if and(>(c-mode 0) not(in-prompt))
  536.   (
  537.     ""
  538.     backward-character
  539.   )
  540.   fi
  541. ))
  542. ;OCL}}}
  543. ;OCL{{{  paired-singlequotes
  544. (deffun paired-singlequotes
  545. (
  546.   "'
  547.   if and(>(c-mode 0) not(in-prompt))
  548.   (
  549.     "'
  550.     backward-character
  551.   )
  552.   fi
  553. ))
  554. ;OCL}}}
  555. ;OCL{{{  semicolon
  556. ( defvar ( x_pos_sem ) )
  557. (deffun semicolon
  558. (
  559.   if or(<=(c-mode 0) in-prompt) ("; )
  560.   else
  561.   (
  562.     end-of-line
  563.     backward-character
  564.     if not(test-char ";)
  565.     (
  566.       if not(test-char " ) (forward-character) fi
  567.       ";
  568.     )
  569.     fi
  570.     beginning-of-line
  571.     set x_pos_sem store-pos
  572.     next-line
  573.     beginning-of-line
  574.     if test-char-set space (previous-line beginning-of-line next-line)
  575.     else
  576.     (
  577.       set x_pos_sem -(x_pos_sem store-pos)
  578.       if >(x_pos_sem 0) (previous-line end-of-line newline-and-indent) fi
  579.     )
  580.     fi
  581.   )
  582.   fi
  583. ))
  584. ;OCL}}}
  585. ;OCL{{{  make-it
  586. (deffun make-it
  587. (
  588.   if not(in-prompt)
  589.   (
  590.     save-file
  591.     local ( force-bourne-shell )
  592.     ( set force-bourne-shell true
  593.       shell-command "make newline-and-indent
  594.     )
  595.   )
  596.   fi
  597. ))
  598. ;OCL}}}
  599. ;OCL{{{  compile-it
  600. (deffun compile-it
  601. (
  602.   if not(in-prompt)
  603.   (
  604.     save-file
  605.     local ( force-bourne-shell )
  606.     ( set force-bourne-shell true
  607.       shell-command "cc "  "$ORIGAMIFILE newline-and-indent
  608.     )
  609.   )
  610.   fi
  611. ))
  612. ;OCL}}}
  613. ;OCL{{{  beautify-c-code
  614. (deffun beautify-c-code
  615. (
  616.   if not(in-prompt)
  617.   ( local ( force-bourne-shell )
  618.     ( set force-bourne-shell true
  619.       filter-buffer "cb newline-and-indent
  620.     )
  621.   )
  622.   fi
  623. ))
  624. ;OCL}}}
  625. ;OCL}}}
  626. ;OCL{{{  check-out
  627. (deffun check-out
  628. (
  629.   if not(in-prompt)
  630.   (
  631.     delete-mode-view
  632.     local ( force-bourne-shell )
  633.     ( set force-bourne-shell true
  634.       shell-command "co "  "-l "  "$ORIGAMIFILE newline-and-indent
  635.     )
  636.   )
  637.   fi
  638. ))
  639. ;OCL}}}
  640. ;OCL{{{  check-in
  641. (deffun check-in
  642. (
  643.   if not(in-prompt)
  644.   (
  645.     save-file
  646.     add-mode-view
  647.     local ( force-bourne-shell )
  648.     ( set force-bourne-shell true
  649.       shell-command "ci "  "-u "  "$ORIGAMIFILE newline-and-indent
  650.     )
  651.   )
  652.   fi
  653. ))
  654. ;OCL}}}
  655. ;OCL{{{  spell-it
  656. ;OCL{{{  string, displayed during pause
  657. ( defmodestring SP "SpellPause "SpellPause )
  658. ;OCL}}}
  659. ;OCL{{{  pre-spell-edit-command
  660. ( defmac pre-spell-edit-command
  661.    ( set prompting false
  662.      set-user-mode SP
  663.    )
  664. )
  665. ;OCL}}}
  666. ;OCL{{{  get lib
  667. @use ( PRE-SPELL-EDIT-COMMAND )
  668. @lib spell
  669. @use not( PRE-SPELL-EDIT-COMMAND )
  670. ;OCL}}}
  671. ;OCL{{{  spell-it
  672. (deffun spell-it
  673.    ( set prompting true
  674.      reset-user-mode SP
  675.      spell-buffer
  676.      set prompting false
  677.    )
  678. )
  679. ;OCL}}}
  680. ;OCL{{{  undeclares
  681. ( undeclare ( pre-spell-edit-command ) )
  682. ;OCL}}}
  683. ;OCL}}}
  684. ;OCL{{{  other-buffer
  685. (deffun other-buffer
  686. (
  687.   if =(current-buffer-number used-buffers) (goto-buffer-number 1)
  688.   else (next-buffer)
  689.   fi
  690. ))
  691. ;OCL}}}
  692. ;OCL{{{  regions handling
  693. ;OCL{{{  variables
  694. ( defvar 16
  695.    ( mark-used
  696.      mark-line-m
  697.      mark-line-no
  698.      mark-buff
  699.      mark-x
  700.    )
  701. )
  702. ( defvar
  703.    ( mark-index
  704.      mark-index-base
  705.      mark-help-1
  706.      mark-help-2
  707.      mark-help-3
  708.      mark-max-length
  709.    )
  710. )
  711. ;OCL}}}
  712. ;OCL{{{  internal functions
  713. ;OCL{{{  get-mark-index
  714. ( deffun get-mark-index
  715.    ( set mark-index mark-index-base
  716.      repeat 16
  717.       ( if =(mark-buff(mark-index) current-buffer-id)
  718.          ( return-from-macro )
  719.         else
  720.          ( set mark-index modulo(+(mark-index 1) 16) )
  721.         fi
  722.       )
  723.      set mark-used(mark-index) false
  724.      set mark-buff(mark-index) current-buffer-id
  725.      set mark-index-base +(mark-index-base 1)
  726.    )
  727. )
  728. ;OCL}}}
  729. ;OCL{{{  go-mark-or-no
  730. @lib go-line
  731. ( deffun ( m n ) go-mark-or-no
  732.    (
  733.      set go-line-arg n
  734.      go-line
  735.      local
  736.       ( modify-behaviour )
  737.       ( set modify-behaviour true
  738.         goto-line-mark m
  739.       )
  740.    )
  741. )
  742. ;OCL}}}
  743. ;OCL{{{  set-mark
  744. ( deffun set-mark
  745.    ( set mark-line-m(mark-index) store-line-mark
  746.      set mark-line-no(mark-index) store-line
  747.      set mark-x(mark-index) +(store-pos set-space-enter)
  748.      set mark-used(mark-index) true
  749.    )
  750. )
  751. ;OCL}}}
  752. ;OCL{{{  region-op
  753. @lib regions
  754. ( deffun ( op ) region-op
  755.    ( get-mark-index
  756.      ;OCL{{{  check view mode
  757.      if test-view ( "  return-from-macro ) fi
  758.      ;OCL}}}
  759.      ;OCL{{{  check set mark
  760.      if not(mark-used(mark-index))
  761.       ( message ( "No "  "mark "  "set! )
  762.         return-from-macro
  763.       )
  764.      fi
  765.      ;OCL}}}
  766.      screen-off
  767.      ;OCL{{{  get real adresses of selected region
  768.      set-start-mark
  769.      end-of-line
  770.      set mark-max-length store-pos
  771.      go-mark-or-no(mark-line-m(mark-index) mark-line-no(mark-index))
  772.      goto -(mark-x(mark-index) set-space-enter)
  773.      set-end-mark
  774.      end-of-line
  775.      if >(store-pos mark-max-length) ( set mark-max-length store-pos ) fi
  776.      ;OCL}}}
  777.      ;OCL{{{  fold region
  778.      ;OCL{{{  correct mark positions (spot is left from the marked char)
  779.      ;OCL{{{  calc -1 for one of the marks
  780.      case
  781.       ;OCL{{{  c over m, left end
  782.       ( >(end-y start-y) ( set end-x -(end-x 1) ) )
  783.       ;OCL}}}
  784.       ;OCL{{{  c under m, left start
  785.       ( >(start-y end-y) ( set start-x -(start-x 1) change-mark-counters ) )
  786.       ;OCL}}}
  787.       ;OCL{{{  start behind m, left start
  788.       ( >(start-x end-x) ( set start-x -(start-x 1) change-mark-counters ) )
  789.       ;OCL}}}
  790.       ;OCL{{{  start before m, left end
  791.       ( >(end-x start-x) ( set end-x -(end-x 1) ) )
  792.       ;OCL}}}
  793.       ;OCL{{{  same position and create-fold -> do at position
  794.       ( =(op no-operation)
  795.          ( goto start-x
  796.            create-fold
  797.            create-fold
  798.            screen-on
  799.            redraw-display
  800.            return-from-macro
  801.          )
  802.       )
  803.       ;OCL}}}
  804.      default
  805.       ;OCL{{{  error
  806.       ( screen-on
  807.         redraw-display
  808.         message ( "empty "  "region )
  809.         return-from-macro
  810.       )
  811.       ;OCL}}}
  812.      esac
  813.      ;OCL}}}
  814.      ;OCL{{{  end-x <= linestart -> previous line
  815.      if
  816.         or
  817.          ( <=(end-x 0)
  818.            pre
  819.             ( set go-line-arg end-y go-line beginning-of-line )
  820.               or (>(store-pos end-x) test-end-line)
  821.          )
  822.       ( set end-y -(end-y 1)
  823.         set end-x mark-max-length
  824.       )
  825.      fi
  826.      ;OCL}}}
  827.      ;OCL}}}
  828.      fold-region
  829.      if folderr
  830.       ( screen-on
  831.         redraw-display
  832.         message ( M_FOLDERR )
  833.         return-from-macro
  834.       )
  835.      fi
  836.      ;OCL}}}
  837.      set mark-used(mark-index) false
  838.      case
  839.       ;OCL{{{  no-operation -> ready
  840.       ( =(op no-operation)
  841.          ( set-mark
  842.            screen-on
  843.            redraw-display
  844.            return-from-macro
  845.          )
  846.       )
  847.       ;OCL}}}
  848.       ;OCL{{{  copy-to-kill-buffer -> do and restore old
  849.       ( =(op copy-to-kill-buffer)
  850.          (
  851.            ;OCL{{{  copy-kill all lines
  852.            enter-fold
  853.            while not(test-bottom)
  854.             ( copy-to-kill-buffer
  855.               next-line
  856.             )
  857.            exit-fold
  858.            ;OCL}}}
  859.            unfold-fold
  860.            ;OCL{{{  maybe combine start
  861.            if <>(start-splitted 0)
  862.             ( combine-splitted-parts-start )
  863.            fi
  864.            ;OCL}}}
  865.            ;OCL{{{  maybe combine end
  866.            if <>(end-splitted 0)
  867.             ( combine-splitted-parts-end )
  868.            fi
  869.            ;OCL}}}
  870.            set-mark
  871.            screen-on
  872.            redraw-display
  873.            return-from-macro
  874.          )
  875.       )
  876.       ;OCL}}}
  877.      default
  878.       ;OCL{{{  kill and delete-line
  879.       ( if =(op delete-line)
  880.          ( delete-line )
  881.         else
  882.          ;OCL{{{  kill all lines
  883.          ( enter-fold
  884.            while not(test-bottom)
  885.             ( kill-line )
  886.            exit-fold
  887.            unfold-fold
  888.          )
  889.          ;OCL}}}
  890.         fi
  891.         ;OCL{{{  maybe join lines
  892.         if and(<>(start-splitted 0) <>(end-splitted 0))
  893.          ( combine-splitted-parts-start )
  894.         fi
  895.         ;OCL}}}
  896.         set-mark
  897.         screen-on
  898.         redraw-display
  899.         return-from-macro
  900.       )
  901.       ;OCL}}}
  902.      esac
  903.    )
  904. )
  905. ;OCL}}}
  906. ;OCL}}}
  907. ;OCL{{{  emori-set-mark
  908. ( deffun emori-set-mark
  909.    ( get-mark-index
  910.      set-mark
  911.      message ( "[Mark "  "set] )
  912.    )
  913. )
  914. ;OCL}}}
  915. ;OCL{{{  change-mark-and-position
  916. ( deffun change-mark-and-position
  917.    ( get-mark-index
  918.      if mark-used(mark-index)
  919.       ;OCL{{{  change
  920.       ( set mark-help-1 mark-line-m(mark-index)
  921.         set mark-help-2 mark-line-no(mark-index)
  922.         set mark-help-3 mark-x(mark-index)
  923.         set-mark
  924.         go-mark-or-no(mark-help-1 mark-help-2)
  925.         goto -(mark-help-3 set-space-enter)
  926.       )
  927.       ;OCL}}}
  928.      else
  929.       ;OCL{{{  set
  930.       ( set-mark )
  931.       ;OCL}}}
  932.      fi
  933.      message ( "[Mark "  "set] )
  934.    )
  935. )
  936. ;OCL}}}
  937. ;OCL{{{  emori-copy-region
  938. ( deffun emori-copy-region
  939.    (
  940.      ;OCL{{{  store view-mode
  941.      set mark-help-1 false
  942.      if test-view
  943.       ( set mark-help-1 true
  944.         delete-mode-view
  945.       )
  946.      fi
  947.      ;OCL}}}
  948.      ;OCL{{{  store change-mode
  949.      set mark-help-2 counter test-file-changed
  950.      ;OCL}}}
  951.      region-op(copy-to-kill-buffer)
  952.      ;OCL{{{  restore change-mode
  953.      if not(mark-help-2)
  954.       ( set-file-unchanged )
  955.      fi
  956.      ;OCL}}}
  957.      ;OCL{{{  store view-mode
  958.      if mark-help-1
  959.       ( add-mode-view )
  960.      fi
  961.      ;OCL}}}
  962.    )
  963. )
  964. ;OCL}}}
  965. ;OCL{{{  emori-kill-region
  966. ( deffun emori-kill-region ( region-op(kill-line) ) )
  967. ;OCL}}}
  968. ;OCL{{{  emori-delete-region
  969. ( deffun emori-delete-region ( region-op(delete-line) ) )
  970. ;OCL}}}
  971. ;OCL{{{  emori-fold-region
  972. ( deffun emori-fold-region
  973.    ( case
  974.       ( test-folding ( create-fold ) )
  975.      default
  976.       ( region-op(no-operation) )
  977.      esac
  978.    )
  979. )
  980. ;OCL}}}
  981. ;OCL{{{  emori-highlight-region
  982. ( defvar ( h-r-chg-pos ) )
  983. ( deffun emori-highlight-region
  984.    ( if not(test-folding)
  985.       ( screen-off
  986.         change-mark-and-position
  987.         if
  988.          ;OCL{{{  mark is after cursor
  989.            or
  990.             ( >(store-line mark-line-no(mark-index))
  991.               and
  992.                ( =(store-line mark-line-no(mark-index))
  993.                  >(+(store-pos set-space-enter) mark-x(mark-index))
  994.                )
  995.             )
  996.          ;OCL}}}
  997.          ;OCL{{{  move back
  998.          ( if =(store-pos 1)
  999.             ( previous-line
  1000.               end-of-line
  1001.               set h-r-chg-pos 1
  1002.             )
  1003.            else
  1004.             ( backward-character
  1005.               set h-r-chg-pos -1
  1006.             )
  1007.            fi
  1008.          )
  1009.          ;OCL}}}
  1010.         else
  1011.          ;OCL{{{  no correctionmove for cursor
  1012.          ( set h-r-chg-pos 0 )
  1013.          ;OCL}}}
  1014.         fi
  1015.         ;OCL{{{  start highlight
  1016.         local
  1017.          ( modify-behaviour )
  1018.          ( set modify-behaviour -2
  1019.            create-fold
  1020.          )
  1021.         ;OCL}}}
  1022.         ;OCL{{{  if cursor-mark, move forward one char
  1023.         case
  1024.          ( >(h-r-chg-pos 0)  ( next-line goto 1 ) )
  1025.          ( <>(h-r-chg-pos 0) ( forward-character ) )
  1026.         esac
  1027.         ;OCL}}}
  1028.         ;OCL{{{  move back to calling position
  1029.         change-mark-and-position
  1030.         ;OCL}}}
  1031.         screen-on
  1032.         redraw-display
  1033.         ;OCL{{{  if highlighted display, delay and redraw afterwards
  1034.         if test-folding
  1035.          ( if =(h-r-chg-pos 0)
  1036.             ;OCL{{{  move back
  1037.             ( if =(store-pos 1)
  1038.                ( previous-line
  1039.                  end-of-line
  1040.                  set h-r-chg-pos 1
  1041.                )
  1042.               else
  1043.                ( backward-character
  1044.                  set h-r-chg-pos -1
  1045.                )
  1046.               fi
  1047.             )
  1048.             ;OCL}}}
  1049.            else
  1050.             ;OCL{{{  no correctionmove for cursor
  1051.             ( set h-r-chg-pos 0 )
  1052.             ;OCL}}}
  1053.            fi
  1054.            show-cursor +(5 *(10 +(read-repeat 1)))
  1055.            create-fold
  1056.            ;OCL{{{  if cursor-mark, move forward one char
  1057.            case
  1058.             ( >(h-r-chg-pos 0)  ( next-line goto 1 ) )
  1059.             ( <>(h-r-chg-pos 0) ( forward-character ) )
  1060.            esac
  1061.            ;OCL}}}
  1062.          )
  1063.         fi
  1064.         ;OCL}}}
  1065.       )
  1066.      fi
  1067.    )
  1068. )
  1069. ( undeclare ( h-r-chg-pos ) )
  1070. ;OCL}}}
  1071. ;OCL{{{  undeclares
  1072. ( undeclare
  1073.    ( mark-used
  1074.      mark-line-m
  1075.      mark-line-no
  1076.      mark-buff
  1077.      mark-index
  1078.      mark-index-base
  1079.      mark-x
  1080.      mark-help-1
  1081.      mark-help-2
  1082.      mark-help-3
  1083.      mark-max-length
  1084.      region-op
  1085.      get-mark-index
  1086.    )
  1087. )
  1088. ;OCL}}}
  1089. ;OCL}}}
  1090. ;OCL{{{  emori-exit-buffer
  1091. (deffun emori-exit-buffer(if =(used-buffers 1)(message(M_NO_BUFFERS))else(exit-buffer)fi))
  1092. ;OCL}}}
  1093. ;OCL{{{  emori-go-mouse-position
  1094. @lib go-mouse
  1095. ;OCL{{{  variables
  1096. ( defvar
  1097.    ( mouse-click-time
  1098.      mouse-clicked-x
  1099.      mouse-clicked-y
  1100.      mouse-moved
  1101.      mouse-down
  1102.      mouse-down-x
  1103.      mouse-down-y
  1104.      mouse-up-x
  1105.      mouse-up-y
  1106.    )
  1107. )
  1108. ;OCL}}}
  1109. ( deffun emori-go-mouse-position
  1110.    ( go-mouse-position
  1111.      if mouse-b
  1112.       ;OCL{{{  go to and store down event/down-movement
  1113.       ( set mouse-moved ocl-argument
  1114.         set mouse-click-time +(mouse-click-time 1)
  1115.         set mouse-down true
  1116.         set mouse-down-x store-pos
  1117.         set mouse-down-y store-line-mark
  1118.       )
  1119.       ;OCL}}}
  1120.      else
  1121.       ;OCL{{{  go and handle mark-set or open/close
  1122.       ( if or(ocl-argument mouse-moved <>(mouse-click-time -(key-count 1)))
  1123.          ;OCL{{{  additional single click action
  1124.          ( if and(mouse-down ocl-argument)
  1125.             ;OCL{{{  set mark at first position
  1126.             ( screen-off
  1127.               set mouse-up-x store-pos
  1128.               set mouse-up-y store-line-mark
  1129.               goto-line-mark mouse-down-y
  1130.               goto mouse-down-x
  1131.               emori-set-mark
  1132.               goto-line-mark mouse-up-y
  1133.               goto mouse-up-x
  1134.               screen-on
  1135.               set mouse-down false
  1136.               redraw-display
  1137.               message ( "[mouse-down: "  "Mark "  "set] )
  1138.             )
  1139.             ;OCL}}}
  1140.            fi
  1141.            set mouse-moved 0
  1142.          )
  1143.          ;OCL}}}
  1144.         else
  1145.          ;OCL{{{  additional double click action
  1146.          ( case
  1147.             ;OCL{{{  fold -> open
  1148.             ( test-fold-line ( open-fold ) )
  1149.             ;OCL}}}
  1150.             ;OCL{{{  filed-fold -> enter
  1151.             ( test-filed ( enter-fold ) )
  1152.             ;OCL}}}
  1153.            default
  1154.             ;OCL{{{  close or exit
  1155.             ( if last-message M_USE_EXIT () fi
  1156.               if last-message M_TOP () fi
  1157.               close-fold
  1158.               if or(last-message M_USE_EXIT last-message M_TOP)
  1159.                ( exit-fold )
  1160.               fi
  1161.             )
  1162.             ;OCL}}}
  1163.            esac
  1164.            ; message "double
  1165.          )
  1166.          ;OCL}}}
  1167.         fi
  1168.         set mouse-click-time key-count
  1169.       )
  1170.       ;OCL}}}
  1171.      fi
  1172.    )
  1173. )
  1174. ;OCL{{{  undeclares
  1175. ( undeclare
  1176.    ( mouse-click-time
  1177.      mouse-clicked-x
  1178.      mouse-clicked-y
  1179.      mouse-moved
  1180.      mouse-down
  1181.      mouse-down-x
  1182.      mouse-down-y
  1183.      mouse-up-x
  1184.      mouse-up-y
  1185.    )
  1186. )
  1187. ;OCL}}}
  1188. ;OCL}}}
  1189. ;OCL{{{  emori-redraw-display
  1190. ( deffun emori-redraw-display
  1191.    ( local
  1192.       ( ocl-argument )
  1193.       ( set ocl-argument cursor-level
  1194.         screen-off
  1195.         center-and-redraw-display
  1196.         set-cursor-line ocl-argument
  1197.         screen-on
  1198.         redraw-display
  1199.       )
  1200.    )
  1201. )
  1202. ;OCL}}}
  1203. ;OCL{{{  emori-delete-line
  1204. ( defvar ( em-d-l-x emori-delete-line-skip-newline ) )
  1205. ( deffun emori-delete-line
  1206.    ( if test-end-line
  1207.       ;OCL{{{  join or delete
  1208.       ( set em-d-l-x store-pos
  1209.         beginning-of-line
  1210.         if test-end-line
  1211.          ;OCL{{{  handle a empty line
  1212.          ( if emori-delete-line-skip-newline
  1213.             ;OCL{{{  delete it, without moving it to a buffer
  1214.             ( delete-line
  1215.               pop-delete-buffer
  1216.               set emori-delete-line-skip-newline false
  1217.             )
  1218.             ;OCL}}}
  1219.            else
  1220.             ;OCL{{{  kill/delete the empty line
  1221.             ( if modify-behaviour
  1222.                ( kill-line )
  1223.               else
  1224.                ( delete-line )
  1225.               fi
  1226.             )
  1227.             ;OCL}}}
  1228.            fi
  1229.            screen-off
  1230.            goto 1
  1231.            while <(store-pos em-d-l-x)
  1232.             ( if last-message M_ERR_PO () fi
  1233.               "  ;
  1234.               if last-message M_ERR_PO ( forward-character ) fi
  1235.             )
  1236.            screen-on
  1237.            refresh-line
  1238.          )
  1239.          ;OCL}}}
  1240.         else
  1241.          ;OCL{{{  join lines
  1242.          ( goto em-d-l-x
  1243.            raw-delete-character
  1244.          )
  1245.          ;OCL}}}
  1246.         fi
  1247.       )
  1248.       ;OCL}}}
  1249.      else
  1250.       ;OCL{{{  delete rest of line
  1251.       ( delete-to-end-of-line
  1252.         set emori-delete-line-skip-newline true
  1253.       )
  1254.       ;OCL}}}
  1255.      fi
  1256.    )
  1257. )
  1258. ( undeclare ( em-d-l-x emori-delete-line-skip-newline ) )
  1259. ;OCL}}}
  1260. ;OCL{{{  emori-kill-line
  1261. ( deffun emori-kill-line
  1262.    ( if not(in-prompt)
  1263.       ( local
  1264.          ( modify-behaviour )
  1265.          ( set modify-behaviour true
  1266.            emori-delete-line
  1267.          )
  1268.       )
  1269.      fi
  1270.    )
  1271. )
  1272. ;OCL}}}
  1273. ;OCL{{{  emori-delete-character
  1274. ( defvar ( d-c-x ) )
  1275. ( deffun emori-delete-character
  1276.    ( if or(in-prompt test-overwrite)
  1277.       ( delete-character )
  1278.      else
  1279.       ( set d-c-x store-pos
  1280.         if and(test-end-line pre ( beginning-of-line ) test-end-line)
  1281.          ( delete-line
  1282.            pop-delete-buffer
  1283.          )
  1284.         else
  1285.          ( goto d-c-x
  1286.            delete-character
  1287.          )
  1288.         fi
  1289.         while <(store-pos d-c-x)
  1290.          ( "  )
  1291.       )
  1292.      fi
  1293.    )
  1294. )
  1295. ( undeclare ( d-c-x ) )
  1296. ;OCL}}}
  1297. ;OCL{{{  funny functions
  1298. ( demand-load
  1299.    ( ( defmac SOKOBAN-RESET-KBD ( edit ) )
  1300.      @lib sokoban
  1301.      ( undeclare ( SOKOBAN-RESET-KBD ) )
  1302.      @lib towers
  1303.      ( undeclare ( towers-of-hanoi ) )
  1304.      ( defmac towers-of-hanoi ( tower-display ) )
  1305.      ( undeclare ( tower-display ) )
  1306.    )
  1307. )
  1308. ;OCL}}}
  1309. ;OCL}}}
  1310.  
  1311. ;OCL{{{  hooks
  1312. ;OCL{{{  read-new-file-hook
  1313. (defvar (first-read-newfile startup-x ))
  1314. ;OCL{{{  start-up
  1315. (demand-load (
  1316.   (deffun start-up
  1317.   (
  1318.     ;OCL{{{  ocl-argument and modes
  1319.     if =(ocl-argument -1)
  1320.     ( add-mode-time
  1321.     ) else
  1322.     (
  1323.       ;OCL{{{  handle ocl-argument
  1324.       do
  1325.       (
  1326.         set startup-x ocl-argument
  1327.         ;OCL{{{  time
  1328.         if >=(startup-x 64)
  1329.         (
  1330.           set startup-x -(startup-x 64)
  1331.         ) else
  1332.         (
  1333.           add-mode-time
  1334.         ) fi
  1335.         ;OCL}}}
  1336.         ;OCL{{{  ai
  1337.         if >=(startup-x 32)
  1338.         (
  1339.           delete-mode-autoindent
  1340.           set startup-x -(startup-x 32)
  1341.         ) else
  1342.         (
  1343.           add-mode-autoindent
  1344.         ) fi
  1345.         ;OCL}}}
  1346.         ;OCL{{{  regular expressions
  1347.         if >=(startup-x 16)
  1348.         (
  1349.           add-mode-basic-regular-expression
  1350.           set startup-x -(startup-x 16)
  1351.         ) else
  1352.         (
  1353.           if >=(startup-x 8)
  1354.           (
  1355.             add-mode-extended-regular-expression
  1356.             set startup-x -(startup-x 8)
  1357.           ) else
  1358.           (
  1359.             delete-mode-regular-expression
  1360.           ) fi
  1361.         ) fi
  1362.         ;OCL}}}
  1363.         ;OCL{{{  posi
  1364.         if >=(startup-x 4)
  1365.         (
  1366.           add-mode-position
  1367.           set startup-x -(startup-x 4)
  1368.         ) else
  1369.         (
  1370.           delete-mode-position
  1371.         ) fi
  1372.         ;OCL}}}
  1373.         ;OCL{{{  c
  1374.         if >=(startup-x 2)
  1375.         (
  1376.           add-mode-c
  1377.           set startup-x -(startup-x 2)
  1378.         ) else
  1379.         (
  1380.           delete-mode-c
  1381.         ) fi
  1382.         ;OCL}}}
  1383.         ;OCL{{{  full shift
  1384.         if >=(startup-x 1)
  1385.         (
  1386.           add-mode-full-shift
  1387.           set startup-x -(startup-x 1)
  1388.         ) else
  1389.         (
  1390.           delete-mode-full-shift
  1391.         ) fi
  1392.         ;OCL}}}
  1393.         ;OCL{{{  error detection
  1394.         if <>(startup-x 0)
  1395.         (
  1396.           set first-read-newfile -1
  1397.           set ocl-argument 0
  1398.         ) fi
  1399.         ;OCL}}}
  1400.       ) while <>(startup-x 0)
  1401.       ;OCL}}}
  1402.     ) fi
  1403.     ;OCL}}}
  1404.     update-ai-statline
  1405.   ))
  1406. ))
  1407. ;OCL}}}
  1408. ( deffun read-new-file-hook
  1409. (
  1410.   ;OCL{{{  startup
  1411.   if =(first-read-newfile 0)
  1412.   ( start-up
  1413.     load-function not( start-up )
  1414.   ) fi
  1415.   ;OCL}}}
  1416.   ;OCL{{{  set flags,modes,...
  1417.   reset-pushed-noparse
  1418.   ;OCL}}}
  1419.   ;OCL{{{  maybe startup complain msg
  1420.   case
  1421.    ;OCL{{{  first-read-newfile==-1 ->show error for -O
  1422.    ( =(first-read-newfile -1)
  1423.      ( set first-read-newfile 1
  1424.        message-exit ( "[ "invalid "  "initialization, "  "using "  "default! "] )
  1425.      )
  1426.    )
  1427.    ;OCL}}}
  1428.    ;OCL{{{  first-read-newfile==0  ->show error-list msg
  1429.    ( =(first-read-newfile 0)
  1430.      ( set first-read-newfile 1
  1431.        message-exit ( history error-list )
  1432.      )
  1433.    )
  1434.    ;OCL}}}
  1435.   esac
  1436.   set first-read-newfile 1
  1437.   ;OCL}}}
  1438. ))
  1439. (undeclare (first-read-newfile startup-x))
  1440. ;OCL}}}
  1441. ;OCL{{{  abort-hook
  1442. ( forward lib-abort-hooks )
  1443. ( deffun abort-hook (
  1444.    set modify-behaviour 0
  1445.    lib-abort-hooks
  1446.    set prompting false
  1447.    end-prompt
  1448.    reset-pushed-noparse
  1449.    if and(test-folding <>(ocl-argument 0)) ( create-fold ) fi
  1450.    message-exit ( M_ABORTED )
  1451. ) )
  1452. ;OCL}}}
  1453. (abort-macro abort-hook)
  1454. (read-newfile-macro read-new-file-hook)
  1455. ;OCL}}}
  1456.  
  1457. ;OCL{{{  abort
  1458. (keybind abort (C-G))
  1459. ;OCL}}}
  1460. ;OCL{{{  keytable edit-or
  1461. (mode edit
  1462. ;OCL{{{  motion
  1463. ;OCL{{{  basic cursor
  1464. (keybind backward-character (C-B))
  1465. (terminal
  1466.   @lib emacs-fun/em-term-list
  1467.   (keybind backward-character ($left))
  1468. )
  1469.  
  1470. (keybind forward-character (C-F))
  1471. (terminal
  1472.   @lib emacs-fun/em-term-list
  1473.   (keybind forward-character ($right))
  1474. )
  1475.  
  1476. (keybind previous-line (C-P))
  1477. (terminal
  1478.   @lib emacs-fun/em-term-list
  1479.   (keybind previous-line ($up))
  1480. )
  1481.  
  1482. (keybind next-line (C-N))
  1483. (terminal
  1484.   @lib emacs-fun/em-term-list
  1485.   (keybind next-line ($down))
  1486. )
  1487. ;OCL}}}
  1488. ;OCL{{{  wordwise
  1489. (keybind backward-word (M-"b))
  1490. (keybind forward-word (M-"f))
  1491. ;OCL}}}
  1492. ;OCL{{{  sentence-wise
  1493. (keybind backward-sentence (M-"B))
  1494. (keybind forward-sentence (M-"F))
  1495. ;OCL}}}
  1496. ;OCL{{{  paragraph-wise
  1497. (keybind previous-paragraph (M-"p))
  1498. (keybind next-paragraph (M-"n))
  1499. ;OCL}}}
  1500. ;OCL{{{  page-wise
  1501. (keybind previous-page (M-"v))
  1502. (terminal
  1503.   @lib emacs-fun/em-term-list
  1504.   (keybind previous-page ($prev_page))
  1505. )
  1506.  
  1507. (keybind next-page (C-V))
  1508. (terminal
  1509.   @lib emacs-fun/em-term-list
  1510.   (keybind next-page ($next_page))
  1511. )
  1512. ;OCL}}}
  1513. ;OCL{{{  beginning/end of a line
  1514. (keybind beginning-of-line (C-A))
  1515. (terminal
  1516.   @lib emacs-fun/em-term-list
  1517.   (keybind beginning-of-line ($begin))
  1518. )
  1519.  
  1520. (keybind end-of-line (C-E))
  1521. (terminal
  1522.   @lib emacs-fun/em-term-list
  1523.   (keybind end-of-line ($end))
  1524. )
  1525. ;OCL}}}
  1526. ;OCL{{{  beginning/end of a fold
  1527. (keybind beginning-of-fold (M-"<))
  1528. (terminal
  1529.   @lib emacs-fun/em-term-list
  1530.   (keybind beginning-of-fold ($home))
  1531. )
  1532.  
  1533. (keybind end-of-fold (M-">))
  1534. ;OCL}}}
  1535. ;OCL{{{  go-to-line
  1536. (keybind go-to-line (M-"g))
  1537. ;OCL}}}
  1538. ;OCL{{{  goto-matching-fence
  1539. (keybind goto-matching-fence (M-"#))
  1540. ;OCL}}}
  1541. ;OCL{{{  open-fold
  1542. (keybind open-fold (C-O))
  1543. (terminal
  1544.   @lib emacs-fun/em-term-list
  1545.   (keybind open-fold ($open))
  1546. )
  1547. ;OCL}}}
  1548. ;OCL{{{  close-fold
  1549. (keybind close-fold (C-C))
  1550. (terminal
  1551.   @lib emacs-fun/em-term-list
  1552.   (keybind close-fold ($close))
  1553. )
  1554. ;OCL}}}
  1555. ;OCL{{{  enter-fold
  1556. (keybind emori-enter-fold (M-C-O))
  1557. ;OCL}}}
  1558. ;OCL{{{  exit-fold
  1559. (keybind exit-fold (M-C-C))
  1560. ;OCL}}}
  1561. ;OCL}}}
  1562. ;OCL{{{  editing
  1563. ;OCL{{{  newline-and-indent
  1564. (keybind emori-newline-and-indent (C-J))
  1565. (keybind emori-newline-and-indent (C-M))
  1566. ;OCL}}}
  1567.  
  1568. ;OCL{{{  delete-previous-character
  1569. (keybind delete-previous-character (C-H))
  1570. (terminal
  1571.   @lib emacs-fun/em-term-list
  1572.   (keybind delete-previous-character ($backspace))
  1573. )
  1574. ;OCL}}}
  1575. ;OCL{{{  emori-delete-character
  1576. (keybind emori-delete-character (C-D))
  1577. (keybind emori-delete-character (C-?))
  1578. (terminal
  1579.   @lib emacs-fun/em-term-list
  1580.   (keybind delete-character ($rubout))
  1581. )
  1582. ;OCL}}}
  1583.  
  1584. ;OCL{{{  delete-word-backward
  1585. (keybind delete-word-backward (M-C-H))
  1586. ;OCL}}}
  1587. ;OCL{{{  delete-word
  1588. (keybind delete-word (M-C-D))
  1589. ;OCL}}}
  1590.  
  1591. ;OCL{{{  transpose-characters
  1592. (keybind transpose-characters (C-T))
  1593. ;OCL}}}
  1594.  
  1595. ;OCL{{{  case-word-capitalize
  1596. (keybind case-word-capitalize (M-"c))
  1597. ;OCL}}}
  1598. ;OCL{{{  case-word-upper
  1599. (keybind case-word-upper (M-"u))
  1600. ;OCL}}}
  1601. ;OCL{{{  case-word-lower
  1602. (keybind case-word-lower (M-"l))
  1603. ;OCL}}}
  1604.  
  1605. ;OCL{{{  emori-delete-line
  1606. (keybind emori-delete-line (M-C-K))
  1607. (terminal
  1608.   @lib emacs-fun/em-term-list
  1609.   (keybind emori-delete-line ($delline))
  1610. )
  1611. ;OCL}}}
  1612. ;OCL{{{  undo-delete-line
  1613. (keybind undo-delete-line (M-C-Y))
  1614. ;OCL}}}
  1615. ;OCL{{{  emori-kill-line
  1616. (keybind emori-kill-line (C-K))
  1617. ;OCL}}}
  1618. ;OCL{{{  copy-to-kill-buffer
  1619. (keybind copy-to-kill-buffer (M-"k))
  1620. ;OCL}}}
  1621. ;OCL{{{  insert-folded-kill-buffer
  1622. (keybind insert-folded-kill-buffer (C-Y))
  1623. ;OCL}}}
  1624. ;OCL{{{  unfold-fold
  1625. (keybind unfold-fold (C-U))
  1626. ;OCL}}}
  1627. ;OCL{{{  auto-header
  1628. (keybind auto-header (C-X C-H))
  1629. ;OCL}}}
  1630. ;OCL{{{  toggle-file-fold
  1631. (keybind toggle-file-fold (C-X C-F))
  1632. ;OCL}}}
  1633. ;OCL{{{  toggle-attach-file-to-fold
  1634. (keybind toggle-attach-file-to-fold (C-X C-A))
  1635. ;OCL}}}
  1636. ;OCL}}}
  1637. ;OCL{{{  regions
  1638. ;OCL{{{  emori-set-mark
  1639. (keybind emori-set-mark (C-@))
  1640. ;OCL}}}
  1641. ;OCL{{{  change-mark-and-position
  1642. (keybind change-mark-and-position (C-X C-X))
  1643. ;OCL}}}
  1644. ;OCL{{{  emori-highlight-region
  1645. ( keybind emori-highlight-region ( C-X "x ))
  1646. ;OCL}}}
  1647.  
  1648. ;OCL{{{  emori-delete-region
  1649. (keybind emori-delete-region (M-C-W))
  1650. ;OCL}}}
  1651. ;OCL{{{  emori-kill-region
  1652. (keybind emori-kill-region (C-W))
  1653. ;OCL}}}
  1654. ;OCL{{{  emori-copy-region
  1655. (keybind emori-copy-region (M-"w))
  1656. ;OCL}}}
  1657. ;OCL{{{  emori-fold-region
  1658. ( keybind emori-fold-region ( M-C-@ ) )
  1659. ;OCL}}}
  1660. ;OCL}}}
  1661. ;OCL{{{  search & replace
  1662. ;OCL{{{  search-forward
  1663. (keybind search-forward (M-C-S))
  1664. ;OCL}}}
  1665. ;OCL{{{  search-reverse
  1666. (keybind search-reverse (M-C-R))
  1667. ;OCL}}}
  1668.  
  1669. ;OCL{{{  incremental-search-forward
  1670. (keybind incremental-search-forward (C-S))
  1671. ;OCL}}}
  1672. ;OCL{{{  incremental-search-reverse
  1673. (keybind incremental-search-reverse (C-R))
  1674. ;OCL}}}
  1675.  
  1676. ;OCL{{{  replace-string
  1677. (keybind replace-string (M-"R))
  1678. ;OCL}}}
  1679. ;OCL{{{  query-replace-string
  1680. (keybind query-replace-string (M-"r))
  1681. ;OCL}}}
  1682. ;OCL}}}
  1683. ;OCL{{{  files
  1684. ;OCL{{{  insert-file
  1685. (keybind insert-file (C-X C-I))
  1686. ;OCL}}}
  1687. ;OCL{{{  save-file
  1688. (keybind save-file (C-X C-S))
  1689. (terminal
  1690.   @lib emacs-fun/em-term-list
  1691.   (keybind save-file ($save))
  1692. )
  1693. ;OCL}}}
  1694. ;OCL{{{  write-file
  1695. (keybind write-file (C-X C-W))
  1696. ;OCL}}}
  1697. ;OCL{{{  emori-read-file
  1698. (keybind emori-read-file (C-X C-R))
  1699. ;OCL}}}
  1700.  
  1701. ;OCL{{{  next-file
  1702. (keybind next-file (C-X C-N))
  1703. ;OCL}}}
  1704. ;OCL{{{  previous-file
  1705. (keybind previous-file (C-X C-P))
  1706. ;OCL}}}
  1707.  
  1708. ;OCL{{{  set-file-unchanged
  1709. (keybind set-file-unchanged (M-"~))
  1710. ;OCL}}}
  1711. ;OCL}}}
  1712. ;OCL{{{  tags
  1713. ;OCL{{{  enter-and-go-tags-buffer
  1714. ( keybind emori-enter-and-go-tags-buffer ( M-". ) )
  1715. ;OCL}}}
  1716. ;OCL{{{  find-and-go-tags-buffer
  1717. ( keybind emori-find-and-go-tags-buffer ( M-", ) )
  1718. ;OCL}}}
  1719. ;OCL{{{  set-user-tags-file
  1720. ( keybind emori-set-user-tags-file ( C-X "t ) )
  1721. ;OCL}}}
  1722. ;OCL}}}
  1723. ;OCL{{{  macros
  1724. ;OCL{{{  define-macro
  1725. (keybind define-macro (C-X "())
  1726. (keybind define-macro (C-X ")))
  1727. ;OCL}}}
  1728. ;OCL{{{  execute-macro
  1729. (keybind execute-macro (C-X "e))
  1730. ;OCL}}}
  1731. ;OCL}}}
  1732. ;OCL{{{  shell commands
  1733. ;OCL{{{  shell
  1734. (keybind shell (C-X "c))
  1735. (terminal
  1736.   @lib emacs-fun/em-term-list
  1737.   (keybind shell ($shift-command))
  1738. )
  1739. ;OCL}}}
  1740. ;OCL{{{  shell-command
  1741. (keybind shell-command (C-X "!))
  1742. (terminal
  1743.   @lib emacs-fun/em-term-list
  1744.   (keybind shell-command ($command))
  1745. )
  1746. ;OCL}}}
  1747. ;OCL{{{  filter-buffer
  1748. (keybind filter-buffer (C-X "|))
  1749. ;OCL}}}
  1750. ;OCL{{{  pipe-to-command
  1751. (keybind pipe-to-command (C-X ">))
  1752. ;OCL}}}
  1753. ;OCL{{{  pipe-from-command
  1754. (keybind pipe-from-command (C-X "<))
  1755. ;OCL}}}
  1756. ;OCL{{{  make-it
  1757. (keybind make-it (M-"x "m))
  1758. ;OCL}}}
  1759. ;OCL{{{  compile-it
  1760. (keybind compile-it (M-"x "c))
  1761. ;OCL}}}
  1762. ;OCL{{{  beautify-c-code
  1763. (keybind beautify-c-code (C-X "i))
  1764. ;OCL}}}
  1765. ;OCL{{{  version control interface
  1766. ;OCL{{{  check-out
  1767. (keybind check-out (M-"x "o))
  1768. ;OCL}}}
  1769. ;OCL{{{  check-in
  1770. (keybind check-in (M-"x "i))
  1771. ;OCL}}}
  1772. ;OCL}}}
  1773. ;OCL{{{  spell-it
  1774. (keybind spell-it (M-"x "s))
  1775. ;OCL}}}
  1776. ;OCL}}}
  1777. ;OCL{{{  modes
  1778. ;OCL{{{  autosave
  1779. (keybind add-mode-autosave (C-X "m "a))
  1780. (keybind delete-mode-autosave (C-X C-M "a))
  1781. ;OCL}}}
  1782. ;OCL{{{  c-mode
  1783. (keybind add-mode-c (C-X "m "c))
  1784. (keybind delete-mode-c (C-X C-M "c))
  1785. ;OCL}}}
  1786. ;OCL{{{  set-display-mode
  1787. (keybind set-display-mode ( C-X "m "d ) )
  1788. ;OCL}}}
  1789. ;OCL{{{  full-shift
  1790. (keybind add-mode-full-shift (C-X "m "f))
  1791. (keybind delete-mode-full-shift (C-X C-M "f))
  1792. ;OCL}}}
  1793. ;OCL{{{  autoindent
  1794. (keybind add-mode-autoindent (C-X "m "i))
  1795. (keybind delete-mode-autoindent (C-X C-M "i))
  1796. ;OCL}}}
  1797. ;OCL{{{  set-language
  1798. (keybind set-language (C-X "m "l))
  1799. ;OCL}}}
  1800. ;OCL{{{  regular-expression
  1801. (keybind add-mode-basic-regular-expression (C-X "m "m))
  1802. (keybind delete-mode-regular-expression (C-X C-M "m))
  1803. (keybind add-mode-extended-regular-expression (C-X "m "M))
  1804. (keybind delete-mode-regular-expression (C-X C-M "M))
  1805. ;OCL}}}
  1806. ;OCL{{{  no-parse
  1807. (keybind add-mode-no-parse (C-X "m "n))
  1808. (keybind delete-mode-no-parse (C-X C-M "n))
  1809. ;OCL}}}
  1810. ;OCL{{{  overwrite
  1811. (keybind add-mode-overwrite (C-X "m "o))
  1812. (keybind delete-mode-overwrite (C-X C-M "o))
  1813. ;OCL}}}
  1814. ;OCL{{{  position
  1815. (keybind add-mode-position (C-X "m "p))
  1816. (keybind delete-mode-position (C-X C-M "p))
  1817. ;OCL}}}
  1818. ;OCL{{{  time
  1819. (keybind add-mode-time (C-X "m "t))
  1820. (keybind delete-mode-time (C-X C-M "t))
  1821. ;OCL}}}
  1822. ;OCL{{{  view
  1823. (keybind add-mode-view (C-X "m "v))
  1824. (keybind delete-mode-view (C-X C-M "v))
  1825. ;OCL}}}
  1826. ;OCL{{{  verbose
  1827. (keybind add-mode-verbose (C-X "m "V))
  1828. (keybind delete-mode-verbose (C-X C-M "V))
  1829. ;OCL}}}
  1830. ;OCL{{{  wrap
  1831. (keybind add-mode-wrap (C-X "m "w))
  1832. (keybind delete-mode-wrap (C-X C-M "w))
  1833. ;OCL}}}
  1834. ;OCL{{{  hash-shift
  1835. (keybind add-mode-hash-shift (C-X "m "#))
  1836. (keybind delete-mode-hash-shift (C-X C-M "#))
  1837. ;OCL}}}
  1838. ;OCL}}}
  1839. ;OCL{{{  arguments
  1840. (keybind set-argument-0 (M-"0))
  1841. (keybind set-argument-1 (M-"1))
  1842. (keybind set-argument-2 (M-"2))
  1843. (keybind set-argument-3 (M-"3))
  1844. (keybind set-argument-4 (M-"4))
  1845. (keybind set-argument-5 (M-"5))
  1846. (keybind set-argument-6 (M-"6))
  1847. (keybind set-argument-7 (M-"7))
  1848. (keybind set-argument-8 (M-"8))
  1849. (keybind set-argument-9 (M-"9))
  1850. ;OCL}}}
  1851. ;OCL{{{  special functions
  1852. ;OCL{{{  redraw-display
  1853. (keybind emori-redraw-display (M-C-L))
  1854. (terminal
  1855.   @lib emacs-fun/em-term-list
  1856.   (keybind emori-redraw-display ($refresh))
  1857. )
  1858. ;OCL}}}
  1859. ;OCL{{{  center-and-redraw-display
  1860. (keybind center-and-redraw-display (C-L))
  1861. ;OCL}}}
  1862.  
  1863. ;OCL{{{  emori-help
  1864. (keybind emori-help (M-"?))
  1865. (terminal
  1866.   @lib emacs-fun/em-term-list
  1867.   (keybind emori-help ($help))
  1868. )
  1869. ;OCL}}}
  1870. ;OCL{{{  describe-bindings
  1871. (keybind describe-bindings (C-X "?))
  1872. (terminal
  1873.   @lib emacs-fun/em-term-list
  1874.   (keybind describe-bindings ($shift-help))
  1875. )
  1876. ;OCL}}}
  1877. ;OCL{{{  describe-fold
  1878. (keybind describe-fold (C-X "=))
  1879. ;OCL}}}
  1880. ;OCL{{{  quote-character
  1881. (keybind quote-character (C-Q))
  1882. ;OCL}}}
  1883. ;OCL{{{  filename-or-tag-completion
  1884. (keybind filename-or-tag-completion (M-C-I))
  1885. ;OCL}}}
  1886. ;OCL{{{  fill functions
  1887. ;OCL{{{  fill-paragraph
  1888. (keybind fill-paragraph (M-"q))
  1889. ;OCL}}}
  1890. ;OCL{{{  emori-set-fill-column
  1891. (keybind emori-set-fill-column (C-X "f))
  1892. ;OCL}}}
  1893. (keybind wrap-word (" ))
  1894. ;OCL}}}
  1895. ;OCL}}}
  1896. ;OCL{{{  buffers
  1897. (keybind emori-list-buffers (C-X C-B))
  1898. (terminal
  1899.   @lib emacs-fun/em-term-list
  1900.   (keybind emori-list-buffers ($select))
  1901. )
  1902.  
  1903. (keybind change-buffername (C-X "b))
  1904.  
  1905. ;OCL{{{  opening and closing buffers
  1906. (keybind emori-open-error-buffer (C-X "@))
  1907. (keybind emori-open-buffer (C-X "2))
  1908. (keybind emori-open-adjacent-buffer (C-X "3))
  1909. (keybind emori-exit-buffer (C-X "0))
  1910. ;OCL}}}
  1911. ;OCL{{{  changing between buffers
  1912. (keybind previous-buffer (M-C-X "p))
  1913. (keybind next-buffer (M-C-X "n))
  1914. (keybind other-buffer (C-X "o))
  1915. (keybind up-buffer (M-C-X C-P))
  1916. (keybind down-buffer (M-C-X C-N))
  1917. (keybind left-buffer (M-C-X C-B))
  1918. (keybind right-buffer (M-C-X C-F))
  1919. ;OCL}}}
  1920.  
  1921. ;OCL{{{  full-size-buffer
  1922. (keybind full-size-buffer (C-X "1))
  1923. ;OCL}}}
  1924. ;OCL{{{  grow-buffer
  1925. (keybind grow-buffer (M-C-X "^))
  1926. ;OCL}}}
  1927. ;OCL{{{  shrink-buffer
  1928. (keybind shrink-buffer (M-C-X "v))
  1929. ;OCL}}}
  1930. ;OCL{{{  widen-buffer
  1931. (keybind widen-buffer (M-C-X "<))
  1932. ;OCL}}}
  1933. ;OCL{{{  narrow-buffer
  1934. (keybind narrow-buffer (M-C-X ">))
  1935. ;OCL}}}
  1936. ;OCL}}}
  1937. ;OCL{{{  how to get out
  1938. ;OCL{{{  emori-exit-origami
  1939. (keybind emori-exit-origami (C-X C-C))
  1940. (terminal
  1941.   @lib emacs-fun/em-term-list
  1942.   (keybind emori-exit-origami ($exit))
  1943. )
  1944. ;OCL}}}
  1945. ;OCL{{{  save-and-exit-origami
  1946. (keybind save-and-exit-origami (M-"z))
  1947. (terminal
  1948.   @lib emacs-fun/em-term-list
  1949.   (keybind save-and-exit-origami ($shift-exit))
  1950. )
  1951. ;OCL}}}
  1952. ;OCL{{{  suspend-origami
  1953. (keybind suspend-origami (C-Z))
  1954. (terminal
  1955.   @lib emacs-fun/em-term-list
  1956.   (keybind suspend-origami ($suspend))
  1957. )
  1958. ;OCL}}}
  1959. ;OCL}}}
  1960. ;OCL{{{  c-mode bindings
  1961. (keybind paired-parens ("( ))
  1962. (keybind paired-brackets ("[ ))
  1963. (keybind paired-curly-brackets ("{ ))
  1964. (keybind paired-doublequotes ("" ))
  1965. (keybind paired-singlequotes ("' ))
  1966. (keybind semicolon (";))
  1967. ;OCL}}}
  1968. ;OCL{{{  funny functions
  1969. ( keybind sokoban ( M-"x "k ) )
  1970. ( keybind towers-of-hanoi ( M-"x "t ) )
  1971. ;OCL}}}
  1972. )
  1973. ;OCL}}}
  1974. ;OCL{{{  mode prompt/para-meter
  1975. (mode para
  1976. ;OCL{{{  motion
  1977. ;OCL{{{  backward-character
  1978. (keybind backward-character (C-B))
  1979. (terminal
  1980.   @lib emacs-fun/em-term-list
  1981.   (keybind backward-character ($left))
  1982. )
  1983. ;OCL}}}
  1984. ;OCL{{{  forward-character
  1985. (keybind forward-character (C-F))
  1986. (terminal
  1987.   @lib emacs-fun/em-term-list
  1988.   (keybind forward-character ($right))
  1989. )
  1990. ;OCL}}}
  1991.  
  1992. ;OCL{{{  previous-line
  1993. (keybind previous-line (C-P))
  1994. (terminal
  1995.   @lib emacs-fun/em-term-list
  1996.   (keybind previous-line ($up))
  1997. )
  1998. ;OCL}}}
  1999. ;OCL{{{  next-line
  2000. (keybind next-line (C-N))
  2001. (terminal
  2002.   @lib emacs-fun/em-term-list
  2003.   (keybind next-line ($down))
  2004. )
  2005. ;OCL}}}
  2006.  
  2007. ;OCL{{{  beginning-of-line
  2008. (keybind beginning-of-line (C-A))
  2009. (terminal
  2010.   @lib emacs-fun/em-term-list
  2011.   (keybind beginning-of-line ($begin))
  2012. )
  2013. ;OCL}}}
  2014. ;OCL{{{  end-of-line
  2015. (keybind end-of-line (C-E))
  2016. (terminal
  2017.   @lib emacs-fun/em-term-list
  2018.   (keybind end-of-line ($end))
  2019. )
  2020. ;OCL}}}
  2021. ;OCL}}}
  2022. ;OCL{{{  editing
  2023. ;OCL{{{  newline-and-indent
  2024. (keybind newline-and-indent (C-J))
  2025. (keybind newline-and-indent (C-M))
  2026. ;OCL}}}
  2027.  
  2028. ;OCL{{{  raw-delete-previous-character
  2029. (keybind raw-delete-previous-character (C-H))
  2030. (terminal
  2031.   @lib emacs-fun/em-term-list
  2032.   (keybind raw-delete-previous-character ($backspace))
  2033. )
  2034. ;OCL}}}
  2035. ;OCL{{{  raw-delete-character
  2036. (keybind raw-delete-character (C-D))
  2037. (keybind raw-delete-character (C-?))
  2038. (terminal
  2039.   @lib emacs-fun/em-term-list
  2040.   (keybind raw-delete-character ($rubout))
  2041. )
  2042. ;OCL}}}
  2043.  
  2044. ;OCL{{{  delete-to-end-of-line
  2045. (keybind delete-to-end-of-line (C-K))
  2046. (terminal
  2047.   @lib emacs-fun/em-term-list
  2048.   (keybind delete-to-end-of-line ($clreol))
  2049. )
  2050. ;OCL}}}
  2051. ;OCL}}}
  2052. ;OCL{{{  search & replace
  2053. ;OCL{{{  search-forward
  2054. (keybind search-forward (M-C-S))
  2055. ;OCL}}}
  2056. ;OCL{{{  search-reverse
  2057. (keybind search-reverse (M-C-R))
  2058. ;OCL}}}
  2059.  
  2060. ;OCL{{{  incremental-search-forward
  2061. (keybind incremental-search-forward (C-S))
  2062. ;OCL}}}
  2063. ;OCL{{{  incremental-search-reverse
  2064. (keybind incremental-search-reverse (C-R))
  2065. ;OCL}}}
  2066. ;OCL}}}
  2067. ;OCL{{{  macros
  2068. ;OCL{{{  define-macro
  2069. (keybind define-macro (C-X "())
  2070. (keybind define-macro (C-X ")))
  2071. ;OCL}}}
  2072. ;OCL{{{  execute-macro
  2073. (keybind execute-macro (C-X "e))
  2074. ;OCL}}}
  2075. ;OCL}}}
  2076. ;OCL{{{  arguments
  2077. (keybind set-argument-0 (M-"0))
  2078. (keybind set-argument-1 (M-"1))
  2079. (keybind set-argument-2 (M-"2))
  2080. (keybind set-argument-3 (M-"3))
  2081. (keybind set-argument-4 (M-"4))
  2082. (keybind set-argument-5 (M-"5))
  2083. (keybind set-argument-6 (M-"6))
  2084. (keybind set-argument-7 (M-"7))
  2085. (keybind set-argument-8 (M-"8))
  2086. (keybind set-argument-9 (M-"9))
  2087. ;OCL}}}
  2088. ;OCL{{{  special functions
  2089. ;OCL{{{  quote-character
  2090. (keybind quote-character (C-Q))
  2091. ;OCL}}}
  2092. ;OCL{{{  filename-completion
  2093. (keybind filename-completion (M-C-I))
  2094. ;OCL}}}
  2095. ;OCL}}}
  2096. )
  2097. ;OCL}}}
  2098. ;OCL{{{  mouse
  2099. @if-using not(AMIGA)
  2100.    ( mouse-buttons
  2101.      emori-go-mouse-position      ; Button 1 up
  2102.      no-operation                 ; Button 2 up
  2103.      emori-go-mouse-position      ; Button 3 up
  2104.      no-operation                 ; Button 4 up
  2105.      no-operation                 ; Button 5 up
  2106.      emori-go-mouse-position      ; Button 1 down
  2107.      no-operation                 ; Button 2 down
  2108.      emori-go-mouse-position      ; Button 3 down
  2109.    )
  2110. @fi
  2111. ;OCL}}}
  2112.  
  2113. ;OCL{{{  forwarded libary abort hook
  2114. ( deffun lib-abort-hooks
  2115.    ( @if-using ( ABORT-HOOK-ADD )
  2116.         abort-hook-add
  2117.      @fi
  2118.    )
  2119. )
  2120. ;OCL}}}
  2121.  
  2122. ;OCL{{{  reference tree
  2123. @if-using ( )
  2124. ;OCL{{{  settings
  2125. @start-reference-copy ref-sets
  2126. @ref-indent 4 77 10
  2127. @ref-top-start-box       -
  2128. @ref-top-end-box
  2129. @ref-sub-start-box       -
  2130. @ref-sub-end-box
  2131. @ref-menu 1 quit Quit ret Last next #(Next) prev Prev kill Kill ABCDEFGHIJMORSTUVWXYZ
  2132. @ref-class-id 1
  2133. @ref-see-also See also in: %s
  2134. @end-reference-copy
  2135. ;OCL}}}
  2136. ;OCL{{{  reference frame
  2137. @start-reference-copy ref
  2138. @ref-lib fun/tags-mac.r file-reference
  2139. @ref-lib fun/sokoban.r sokoban-call-ref
  2140. @ref-lib fun/global-ref regexp-reference cmd-reference
  2141. ;OCL{{{  @ref-header EMacs-Reference-Card
  2142. @ref-title EMacs - Reference Card
  2143. @ref-author Michael Haardt
  2144. This is the reference file for EMacs, a binding for the folding-editor
  2145. Origami.
  2146. ;OCL}}}
  2147. ;OCL{{{  EMacs-Reference-Card
  2148. ;OCL{{{  EMacs Command Line Options
  2149. You can use the following commad line options, to control the modes of
  2150. EMacs:
  2151.  
  2152. @ref-start-tbl Off 10 On 10 Mode 40
  2153. -Onotime  @@ -Otime   @@ time display in the statusline
  2154. -Onoposi  @@ -Oposi   @@ position display in the statusline
  2155. -Onofull  @@ -Ofull   @@ full shifting display
  2156. -Onoai    @@ -Oai     @@ autoindent
  2157. -Onomagic @@ -Omagic  @@ regular exprsession search
  2158. -Onomagic @@ -Oxmagic @@ extended regular expression search
  2159. -Onoc     @@ -Oc      @@ c-mode
  2160. @ref-end-tbl
  2161.  
  2162. You can also use the option '-Odefault' to use the default values:
  2163.  
  2164. @ref-start-picture
  2165. -Otime -Onoposi -Onofull -Oai -Onomagic -Onoc
  2166. @ref-end-picture
  2167. ;OCL}}}
  2168. ;OCL{{{  @cmd-opt Origami Command Line Options
  2169. ;OCL}}}
  2170. ;OCL{{{  @regexp Origami Regular Expressions
  2171. ;OCL}}}
  2172. ;OCL{{{  Messages, errors and prompts
  2173. Sometimes EMacs may want to tell you something, like when you did
  2174. something which EMacs does not allow. If it is something simple, such
  2175. as typing a control key sequence which is not associated with any
  2176. command, EMacs will just ignore it. Otherwise, it will also display an
  2177. informative error message at the bottom of the screen. Simple messages
  2178. are displayed in brackets, prompts will appear without brackets and end
  2179. with a question mark.
  2180.  
  2181. When starting using verbose mode, EMacs will be less ignorant and tell
  2182. you more. Look under command line switches and/or modes on how to use
  2183. modes.
  2184. ;OCL}}}
  2185. ;OCL{{{  The status line and the message line
  2186. The line immediately above the bottom line is referred to as the "mode
  2187. line". The mode line looks something like
  2188.  
  2189. @ref-start-picture
  2190.  * EMacs 1.6.79 (None)  teach-emacs
  2191. @ref-end-picture
  2192.  
  2193. This is a very useful "information" line.
  2194.  
  2195. @ref-start-item asterisk (star)
  2196. indicates that changes have been made to the file.
  2197. Immediately after opening or saving a file, there is no star.
  2198. @ref-end-item
  2199. @ref-start-item name ("EMacs" in this case)
  2200. shows the name of your compiled keybinding, which runs on top of the Origami
  2201. interpreter.
  2202. @ref-end-item
  2203. @ref-start-item words inside the parentheses
  2204. indicate the "modes" EMacs is currently in.
  2205. @ref-end-item
  2206. @ref-start-item filename ("teach-emacs" in this case)
  2207. is the name of the file you are currently editing.
  2208. @ref-end-item
  2209.  
  2210. If you use more than one window, each window will have its own mode
  2211. line.
  2212. ;OCL}}}
  2213. ;OCL{{{  Used notation of input
  2214. In the following sections, the notation below is used to describe which
  2215. commands are bound to which keys or sequences of keys.
  2216.  
  2217. @ref-start-item C-<chr>
  2218. Hold the CONTROL key while pressing the character <chr>.
  2219. Thus, C-F would be: hold the CONTROL key and press F. Some
  2220. people may be used to see ^F, here it is C-F.
  2221. @ref-end-item
  2222. @ref-start-item M-<chr>
  2223. If you have no Meta key, then press the ESCAPE key and release
  2224. it, then press the character <chr>. Alternatively, if your
  2225. keyboard has a meta key, then hold it down while typing <chr>.
  2226. @ref-end-item
  2227. @ref-start-item M-C-<chr>
  2228. If you have no Meta key, then press the ESCAPE key and release
  2229. it, then hold the CONTROL key while pressing the character <chr>.
  2230. Otherwise, hold down Meta and Control while typing <chr>.
  2231. @ref-end-item
  2232. ;OCL}}}
  2233. ;OCL{{{  Bound keys and key sequences
  2234. Each key inserts/overwrites its character at the current cursor position,
  2235. unless it is bound to a command, in which case the command will be started.
  2236. If the key is start of a key sequence to which a command is bound, EMacs will
  2237. wait for the rest of that sequence and show what was typed so far in the
  2238. message line.  Killing text means that the text will be erased from the buffer
  2239. and appended to the kill buffer whereas deleting text means just erasing it,
  2240. although a limited undo function is available.
  2241.  
  2242. ;OCL{{{  The general abort command
  2243. @ref-start-item C-G
  2244. The EMacs command used to abort any command, no matter if it requests
  2245. input or not, is C-G. For example, you can used C-G to discard
  2246. a numeric argument, at the beginning of a command that you
  2247. don't want to finish, to abort loading big files and to abort
  2248. running macros.
  2249. @ref-end-item
  2250. ;OCL}}}
  2251. ;OCL{{{  Cursor motion
  2252. ;OCL{{{  Basic cursor control (up, down, left, right)
  2253. Not the best, but the most basic way to move the cursor is to use the
  2254. commands previous-line, backward-character, forward-character and
  2255. next-line. Here, in a more graphical form, are the commands:
  2256.  
  2257. @ref-start-picture
  2258.                      Previous line, C-P
  2259.                            :
  2260. Backward, C-B .. Current cursor position .. Forward, C-F
  2261.                            :
  2262.                      Next line, C-N
  2263. @ref-end-picture
  2264.  
  2265. You'll probably find it easy to think of these by letter: P for
  2266. previous, N for next, B for backward and F for forward. When you go off
  2267. the top or bottom of the screen, the text beyond the edge is shifted
  2268. onto the screen so that your instructions can be carried out while
  2269. keeping the cursor on the screen. If your terminal is supported, then
  2270. the cursor keys will work as well.
  2271. ;OCL}}}
  2272. ;OCL{{{  Move cursor backward/forward one word
  2273. @ref-start-item M-b
  2274. backward-word, moves the cursor back one word.
  2275. @ref-end-item
  2276. @ref-start-item M-f
  2277. backward-word, moves the cursor forward one word.
  2278. @ref-end-item
  2279. ;OCL}}}
  2280. ;OCL{{{  Move cursor backward/forward one sentence
  2281. The end of a sentence in EMacs means a line with a period at its end or
  2282. a period followed by two spaces.
  2283.  
  2284. @ref-start-item M-B
  2285. backward-sentence. Moves the cursor to the beginning of the last sentence.
  2286. @ref-end-item
  2287. @ref-start-item M-F
  2288. forward-sentence. Moves the cursor to the beginning of the next sentence.
  2289. @ref-end-item
  2290. ;OCL}}}
  2291. ;OCL{{{  Move cursor to the previous/next paragraph
  2292. A paragraph in EMacs is text without blank lines and without a period in
  2293. the first column.
  2294.  
  2295. @ref-start-item M-p
  2296. previous-paragraph, moves the cursor to the previous paragraph.
  2297. @ref-end-item
  2298. @ref-start-item M-n
  2299. next-paragraph, moves the cursor to the next paragraph.
  2300. @ref-end-item
  2301. ;OCL}}}
  2302. ;OCL{{{  Move cursor to the previous/next page
  2303. @ref-start-item M-v
  2304. previous-page, move one page back. If your terminal is supported, then
  2305. the NextPage key will also work.
  2306. @ref-end-item
  2307. @ref-start-item C-V
  2308. next-page, move one page forward. If your terminal is supported, then
  2309. the PreviousPage key will also work.
  2310. @ref-end-item
  2311. ;OCL}}}
  2312. ;OCL{{{  Move cursor to the beginning/end of a line
  2313. @ref-start-item C-A
  2314. beginning-of-line, move to the beginning of line. If your terminal is
  2315. supported, the begin key will also work.
  2316. @ref-end-item
  2317. @ref-start-item C-E
  2318. end-of-line, move to the end of line. If your terminal is supported, the
  2319. end key will also work.
  2320. @ref-end-item
  2321. ;OCL}}}
  2322. ;OCL{{{  Move cursor to the beginning/end of a fold
  2323. @ref-start-item M-<
  2324. beginning-of-fold, move to the beginning of the entered fold.
  2325. If your terminal is supported, the home key will also work.
  2326. @ref-end-item
  2327. @ref-start-item M->
  2328. end-of-fold, move to the end of the entered fold.
  2329. @ref-end-item
  2330. ;OCL}}}
  2331. ;OCL{{{  Move cursor to line with a specific number
  2332. @ref-start-item M-g
  2333. go-to-line, moves the cursor to the specified line in an entered
  2334. fold. With a numeric argument, Origami jumps to that line,
  2335. otherwise a prompt asking for it will be issued.
  2336. @ref-end-item
  2337. ;OCL}}}
  2338. ;OCL{{{  Move cursor to matching paren, bracket or brace
  2339. @ref-start-item M-#
  2340. goto-matching-fence, move cursor to matching paren, bracket or brace. If the
  2341. cursor stands not on one of the above mentioned fences, EMacs tries to find
  2342. one of the following more complex structures (Skip1 -> Skip2 [ -> Skip3 ] ->
  2343. Skip1 .. ):
  2344. @ref-start-tbl Language 8 Skip1 10 Skip2 10 Skip3 10
  2345. all @@ #ifdef @@ #else @@ #endif
  2346. all @@ #if @@ #else @@ #endif
  2347. OCL @@ @if-using @@ @fi
  2348. @ref-end-tbl
  2349. @ref-end-item
  2350. ;OCL}}}
  2351. ;OCL{{{  Move cursor in and out of folds
  2352. @ref-start-item C-O
  2353. open-fold, opens the fold under the cursor. If your terminal
  2354. is supported, then the open key will work as well.
  2355. @ref-end-item
  2356. @ref-start-item C-C
  2357. close-fold, closes the current fold and folds inside it. If
  2358. your terminal is supported, then the close key will work as well.
  2359. @ref-end-item
  2360. @ref-start-item M-C-O
  2361. enter-fold, enters the fold under the cursor. If the line is not a fold,
  2362. Origami tries to follow the given include statement or prompts for a filename.
  2363. The environement variable `ORIGAMILIBPATH' may contain a `:' separated list of
  2364. directories (default is `/usr/include').
  2365. @ref-end-item
  2366. @ref-start-item M-C-C
  2367. exit-fold, exits the current fold.
  2368. @ref-end-item
  2369. ;OCL}}}
  2370. ;OCL}}}
  2371. ;OCL{{{  Editing
  2372. ;OCL{{{  Creating a new line
  2373. @ref-start-item C-M
  2374. newline-and-indent, splits the line at the cursor position.  If mode
  2375. @ref-end-item
  2376. @ref-start-item C-J
  2377. Autoindent is active, then the new line is indented as the previous
  2378. line.
  2379. @ref-end-item
  2380. ;OCL}}}
  2381. ;OCL{{{  Deleting characters
  2382. @ref-start-item C-H
  2383. delete-previous-character, deletes the character left to the
  2384. cursor.  Most backspace keys also send C-H.
  2385. @ref-end-item
  2386. @ref-start-item C-D
  2387. delete-character, deletes the character under the cursor.  Most
  2388. @ref-end-item
  2389. @ref-start-item C-?
  2390. delete keys also send a C-?.
  2391. @ref-end-item
  2392. ;OCL}}}
  2393. ;OCL{{{  Exchanging characters
  2394. @ref-start-item C-T
  2395. transpose-characters, exchanges the character under the cursor
  2396. with the character left from the cursor, then moves the cursor
  2397. forward one character.
  2398. @ref-end-item
  2399. ;OCL}}}
  2400. ;OCL{{{  Deleting words
  2401. @ref-start-item M-C-H
  2402. delete-word-backward, deletes word backwards from cursor position.
  2403. @ref-end-item
  2404. @ref-start-item M-C-D
  2405. delete-word, deletes word under cursor position.
  2406. @ref-end-item
  2407. ;OCL}}}
  2408. ;OCL{{{  Changing capitalization of words
  2409. @ref-start-item M-c
  2410. case-word-capitalize, capitalizes the word starting at cursor
  2411. position and moves the cursor forward one word.
  2412. @ref-end-item
  2413. @ref-start-item M-u
  2414. case-word-upper, changes the word to upper case starting at
  2415. cursor position and moves the cursor forward one word.
  2416. @ref-end-item
  2417. @ref-start-item M-l
  2418. case-word-lower, changes the word to lower case starting at
  2419. cursor position and moves the cursor forward one word.
  2420. @ref-end-item
  2421. ;OCL}}}
  2422. ;OCL{{{  Killing, deleting, and getting erased text back
  2423. @ref-start-item C-K
  2424. kill-line, kills all text from cursor position to end of line.
  2425. If the cursor was already at the end of the line, the newline
  2426. character ending the line will be killed, joining the current line
  2427. with the next line.
  2428. @ref-end-item
  2429.  
  2430. @ref-start-item M-C-K  |  delline
  2431. delete-line, deleted all text from cursor position to end of line.
  2432. If the cursor was already at the end of the line, the newline
  2433. character ending the line will be deleted, joining the current line
  2434. with the next line.
  2435. @ref-end-item
  2436.  
  2437. @ref-start-item C-Y
  2438. insert-folded-kill-buffer, moves the kill buffer in a fold and
  2439. yanks this fold back
  2440. @ref-end-item
  2441.  
  2442. @ref-start-item C-X C-Y
  2443. undo-delete-line, yank the last deleted line back
  2444. @ref-end-item
  2445. ;OCL}}}
  2446.  
  2447. ;OCL{{{  copy-to-kill-buffer
  2448. @ref-start-item M-k
  2449. copy-to-kill-buffer, appends the line to the kill buffer without
  2450. killing it
  2451. @ref-end-item
  2452. ;OCL}}}
  2453. ;OCL{{{  unfold-fold
  2454. @ref-start-item C-U
  2455. unfold-fold, removes the fold marks of the fold under the cursor
  2456. @ref-end-item
  2457. ;OCL}}}
  2458. ;OCL{{{  auto-header
  2459. @ref-start-item C-X C-H
  2460. auto-header, copies the first in of the fold under the cursor to
  2461. the fold header
  2462. @ref-end-item
  2463. ;OCL}}}
  2464. ;OCL{{{  toggle-file-fold
  2465. @ref-start-item C-X C-F
  2466. toggle-file-fold, toggles between a fold and a file-fold
  2467. @ref-end-item
  2468. ;OCL}}}
  2469. ;OCL{{{  toggle-attach-file-to-fold
  2470. @ref-start-item C-X C-A
  2471. toggle-attach-file-to-fold, attaches a file to a fold to create a
  2472. file-fold for an already existing file, or unlinks the file from
  2473. the fold
  2474. @ref-end-item
  2475. ;OCL}}}
  2476. ;OCL}}}
  2477. ;OCL{{{  Regions
  2478. Regions in EMacs are parts of the buffer, one end marked by an invisible
  2479. mark, the other by the cursor. The region includes the beginning
  2480. position and excludes the ending position. Regions have to respect the
  2481. fold structure.
  2482.  
  2483. @ref-start-item C-@
  2484. set-mark, set an invisible mark at the current cursor position.
  2485. This function is also bound to control-space, because most keyboards
  2486. generate the same character on C-@ and control-space.
  2487. @ref-end-item
  2488. @ref-start-item C-X C-X
  2489. change-mark-and-position, set the invisible mark at the cursor
  2490. position and move the cursor to the previos location of the mark.
  2491. @ref-end-item
  2492. @ref-start-item C-X x
  2493. highlight-region, show the marked region highlighted. A set argument will
  2494. enhance the display time.
  2495. @ref-end-item
  2496. @ref-start-item M-C-W
  2497. delete-region, delete a region. This can be undone by undo-delete-line.
  2498. @ref-end-item
  2499. @ref-start-item C-W
  2500. kill-region, move the region to the kill buffer.
  2501. @ref-end-item
  2502. @ref-start-item M-w
  2503. copy-region, copy the region in the kill buffer.
  2504. @ref-end-item
  2505. @ref-start-item M-C-@
  2506. fold-region, folds the region.
  2507. @ref-end-item
  2508. ;OCL}}}
  2509. ;OCL{{{  Search/replace
  2510. ;OCL{{{  Search for a string
  2511. @ref-start-item M-C-S
  2512. search-forward, prompts for a string and moves the cursor
  2513. to the next occurence of it.
  2514. @ref-end-item
  2515. @ref-start-item M-C-R
  2516. search-reverse, prompts for a string and moves the cursor
  2517. to the last occurence of it.
  2518. @ref-end-item
  2519. ;OCL}}}
  2520. ;OCL{{{  Incremental search for a string
  2521. Incremental search allows you to see the result of the search while the
  2522. search string is typed/changed.
  2523.  
  2524. @ref-start-item C-S
  2525. incremental-search-forward, switches to incremental search mode
  2526. with default direction forward.
  2527. @ref-end-item
  2528. @ref-start-item C-R
  2529. incremental-search-reverse, switches to incremental search mode
  2530. with default direction backward.
  2531. @ref-end-item
  2532.  
  2533. ;OCL{{{  Functions in incremental search mode
  2534. During incremental search, you can use the following commands:
  2535.  
  2536. @ref-start-item <chr>
  2537. Append the character to the search pattern and search in current
  2538. search direction.
  2539. @ref-end-item
  2540. @ref-start-item C-S
  2541. Move the cursor to the next occurence of the search string and
  2542. switch to search direction forward.
  2543. @ref-end-item
  2544. @ref-start-item C-R
  2545. Move to the previous occurence and switch to searching backward.
  2546. @ref-end-item
  2547. @ref-start-item C-P
  2548. Go back in search history.
  2549. @ref-end-item
  2550. @ref-start-item C-N
  2551. Go forward in search history.
  2552. @ref-end-item
  2553. @ref-start-item C-M  |  C-J
  2554. exit incremental search, leave the cursor where it is.
  2555. @ref-end-item
  2556. @ref-start-item C-H
  2557. remove last letter from search pattern.
  2558. @ref-end-item
  2559. @ref-start-item C-G
  2560. aborts incremental search, sets the cursor to where it was before.
  2561. @ref-end-item
  2562. ;OCL}}}
  2563. ;OCL}}}
  2564. ;OCL{{{  Search and replace
  2565. @ref-start-item M-R
  2566. replace-string, asks for a search string and a replace string
  2567. and replaces all occurences of the search string by the replace
  2568. string.
  2569. @ref-end-item
  2570. @ref-start-item M-R
  2571. query-replace-string, asks for a search string and a replace
  2572. string and gives the choice to replace the search string by the
  2573. replace string at all occurences. During query-replace-string
  2574. the following commands are available:
  2575.  
  2576. @ref-start-item Y
  2577. replace and go to next occurence
  2578. @ref-end-item
  2579. @ref-start-item N
  2580. don't replace and go to next occurence
  2581. @ref-end-item
  2582. @ref-start-item !
  2583. replace all further occurences
  2584. @ref-end-item
  2585. @ref-start-item A
  2586. abort
  2587. @ref-end-item
  2588. @ref-start-item .
  2589. replace this occurence and abort after
  2590. @ref-end-item
  2591. @ref-end-item
  2592. ;OCL}}}
  2593. ;OCL}}}
  2594. ;OCL{{{  Files
  2595. @ref-start-item C-X C-I
  2596. insert-file, inserts the contents of a file at the current position into the
  2597. buffer.
  2598. @ref-end-item
  2599. @ref-start-item C-X C-S
  2600. save-file, writes the buffer back to the edited file. If your
  2601. terminal is supported, the save key will also work.
  2602. @ref-end-item
  2603. @ref-start-item C-X C-W
  2604. write-file, writes the buffer to another file.
  2605. @ref-end-item
  2606. @ref-start-item C-X C-R
  2607. read-file, reads another file into the buffer.  A set argument will read the
  2608. file without parsing.  The state of the mode parsing will not be changed.
  2609. @ref-end-item
  2610. @ref-start-item C-X C-N
  2611. next-file, reads next file from command line argument list into
  2612. the buffer.
  2613. @ref-end-item
  2614. @ref-start-item C-X C-P
  2615. previous-file, reads previous file from command line argument list into
  2616. the buffer.
  2617. @ref-end-item
  2618. @ref-start-item M-~
  2619. set-file-unchanged, marks the buffer as unchanged.
  2620. @ref-end-item
  2621. ;OCL}}}
  2622. ;OCL{{{  Buffers
  2623. Origami has a different buffer concept than most other emacs
  2624. implementations. Each buffer has its own (and only) window to edit it.
  2625. Buffers may not be currently visible, so list-buffers is an important
  2626. function if you get lost.
  2627.  
  2628. @ref-start-item C-X C-B
  2629. list-buffers, show a list of all used buffers and offers a menu
  2630. for selecting another buffer (return moves you back to the old
  2631. position). If your terminal supports it, the select key will
  2632. also work.
  2633. @ref-end-item
  2634. @ref-start-item C-X b
  2635. change-buffername, changes the name of the current buffer
  2636. @ref-end-item
  2637.  
  2638. ;OCL{{{  Opening and closing buffers
  2639. @ref-start-item C-X "2
  2640. open-buffer, open a second buffer by parting the current window
  2641. horizontally.  A set argument will read the file without parsing.  The
  2642. state of the mode parsing will not be changed.
  2643. @ref-end-item
  2644. @ref-start-item C-X "3
  2645. open-adjacent-buffer, open a second buffer by parting the current window
  2646. vertically.  A set argument will read the file without parsing.  The state
  2647. of the mode parsing will not be changed.
  2648. @ref-end-item
  2649. @ref-start-item C-X "0
  2650. exit-buffer, close the current buffer and unify the window with
  2651. the window of the previous buffer
  2652. @ref-end-item
  2653. @ref-start-item C-X @
  2654. show a special buffer containing the last messages.
  2655. @ref-end-item
  2656. ;OCL}}}
  2657. ;OCL{{{  Changing between buffers
  2658. @ref-start-item M-C-X p
  2659. previous-buffer, go to the previous buffer.
  2660. @ref-end-item
  2661. @ref-start-item M-C-X n
  2662. next-buffer, go to the next buffer.
  2663. @ref-end-item
  2664. @ref-start-item C-X o
  2665. other-buffer, go cyclic to the next buffer.
  2666. @ref-end-item
  2667. @ref-start-item M-C-X C-P
  2668. up-buffer, move up one buffer
  2669. @ref-end-item
  2670. @ref-start-item M-C-X C-N
  2671. down-buffer, move down one buffer
  2672. @ref-end-item
  2673. @ref-start-item M-C-X C-B
  2674. left-buffer, move left one buffer
  2675. @ref-end-item
  2676. @ref-start-item M-C-X C-F
  2677. right-buffer, move right one buffer
  2678. @ref-end-item
  2679. ;OCL}}}
  2680. ;OCL{{{  Resizing buffers
  2681. @ref-start-item C-X "1
  2682. full-size-buffer, extend the size of the current buffer to screen size
  2683. @ref-end-item
  2684. @ref-start-item M-C-X ^
  2685. grow-buffer, grow current buffer vertically
  2686. @ref-end-item
  2687. @ref-start-item M-C-X v
  2688. shrink-buffer, shrink current buffer vertically
  2689. @ref-end-item
  2690. @ref-start-item M-C-X <
  2691. widen-buffer, grow current buffer horizontally
  2692. @ref-end-item
  2693. @ref-start-item M-C-X >
  2694. narrow-buffer, shrink current buffer horizontally
  2695. @ref-end-item
  2696. ;OCL}}}
  2697. ;OCL}}}
  2698. ;OCL{{{  Modes
  2699. Unlike most other Emacs implementations, Origami does not seperate
  2700. between major and minor modes. The mode default values can be set
  2701. using command line switches:
  2702.  
  2703. ;OCL{{{  Origami Command Line Options
  2704. ;OCL}}}
  2705. ;OCL{{{  EMacs Command Line Options
  2706. ;OCL}}}
  2707.  
  2708. All modes are related to a buffer, they are set with C-X "m <mode-key>
  2709. and deleted with C-X C-M <mode-key>. The following mode-keys are
  2710. available:
  2711.  
  2712. @ref-start-item "a
  2713. autosave, asks for a time interval and saves the text each time
  2714. after this interval expires
  2715. @ref-end-item
  2716. @ref-start-item "c
  2717. c-mode, syntax support for C
  2718. @ref-end-item
  2719. @ref-start-item "d
  2720. show a menu for changing the used character display mode. This
  2721. mode also can only be changed, not deleted.
  2722. @ref-end-item
  2723. @ref-start-item "f
  2724. full-shift, moving over the right border of the screen will shift
  2725. the whole buffer, not only the current line.
  2726. @ref-end-item
  2727. @ref-start-item "i
  2728. autoindent, new lines will be indented as their predecessor
  2729. @ref-end-item
  2730. @ref-start-item "l
  2731. set-language, sets a new language for fold comments. This mode
  2732. can only be changed and not deleted.
  2733. @ref-end-item
  2734. @ref-start-item "m
  2735. basic-regular-expression, search/replace will use regular
  2736. expressions
  2737. @ref-end-item
  2738. @ref-start-item "M
  2739. extended-regular-expression, search/replace will use extended
  2740. expressions.
  2741. @ref-end-item
  2742. @ref-start-item "n
  2743. no-parse, reading files will be done without fold parsing
  2744. @ref-end-item
  2745. @ref-start-item "o
  2746. overwrite, new text overwrites existing text instead of being
  2747. inserted
  2748. @ref-end-item
  2749. @ref-start-item "p
  2750. position, always show current position in status line
  2751. @ref-end-item
  2752. @ref-start-item "t
  2753. time, display the time right from the filename
  2754. @ref-end-item
  2755. @ref-start-item "v
  2756. view, text can only be viewd but not changed
  2757. @ref-end-item
  2758. @ref-start-item "V
  2759. If set, EMacs will be more verbose in some situations.
  2760. @ref-end-item
  2761. @ref-start-item "w
  2762. wrap, wraps a word to the next line if neccessary
  2763. @ref-end-item
  2764. @ref-start-item "#
  2765. hash-shifting
  2766. @ref-end-item
  2767. ;OCL}}}
  2768. ;OCL{{{  Arguments
  2769. @ref-start-item M-<number>
  2770. set-argument-<number> (number can be a digit from 0 to 9),
  2771. set number as argument for the next executed command. Any
  2772. following typed digits will be part of the number. Most
  2773. commands simply are executed number times, when prefixed by
  2774. an argument.
  2775. @ref-end-item
  2776. ;OCL}}}
  2777. ;OCL{{{  Shell Commands
  2778. ;OCL{{{  shell
  2779. @ref-start-item shift-command  |  C-X "c
  2780. shell, starts a sub shell
  2781. @ref-end-item
  2782. ;OCL}}}
  2783. ;OCL{{{  shell-command
  2784. @ref-start-item command  |  C-X "!
  2785. shell-command, starts a sub shell with a given command
  2786. @ref-end-item
  2787. ;OCL}}}
  2788. ;OCL{{{  filter-buffer
  2789. @ref-start-item C-X "|
  2790. filter-buffer, first saves  current file and then filters it
  2791. through the specified filter command.
  2792. @ref-end-item
  2793. ;OCL}}}
  2794. ;OCL{{{  pipe-to-command
  2795. @ref-start-item C-X ">
  2796. pipe-to-command, feeds the command with the current file as
  2797. standard input.
  2798. @ref-end-item
  2799. ;OCL}}}
  2800. ;OCL{{{  pipe-from-command
  2801. @ref-start-item C-X "<
  2802. pipe-from-command, inserts standard output from command at the
  2803. current position.
  2804. @ref-end-item
  2805. ;OCL}}}
  2806. ;OCL{{{  make-it
  2807. @ref-start-item M-x m
  2808. make-it, invoke make
  2809. @ref-end-item
  2810. ;OCL}}}
  2811. ;OCL{{{  compile-it
  2812. @ref-start-item M-x c
  2813. compile-it, invoke C compiler
  2814. @ref-end-item
  2815. ;OCL}}}
  2816. ;OCL{{{  beautify-c-code
  2817. @ref-start-item C-X "i
  2818. beautify-c-code, filter buffer through beautifier
  2819. @ref-end-item
  2820. ;OCL}}}
  2821. ;OCL{{{  check-out
  2822. @ref-start-item M-x o
  2823. check-out, checks current file out but does *not* reload the
  2824. buffer.
  2825. @ref-end-item
  2826. ;OCL}}}
  2827. ;OCL{{{  check-in
  2828. @ref-start-item M-x i
  2829. check-in, saves buffer and checks file in
  2830. @ref-end-item
  2831. ;OCL}}}
  2832. ;OCL{{{  spell-it
  2833. @ref-start-item M-x s
  2834. spell-it, runs current file through spell and starts an
  2835. interactive search and replace for all misspelled words.
  2836. @ref-end-item
  2837. ;OCL}}}
  2838. ;OCL}}}
  2839. ;OCL{{{  More advanced functions
  2840. ;OCL{{{  C-Mode
  2841. The following characters have a special meaning in C-mode:
  2842.  
  2843. @ref-start-picture
  2844. ( [ { '  "  ;
  2845. @ref-end-picture
  2846.  
  2847. Just play around to get used to them, once you are they save lots of
  2848. typing. In C-mode words consist of letters, digits and underscores.
  2849. ;OCL}}}
  2850. ;OCL{{{  Tags
  2851. ;OCL{{{  enter-and-go-tags-buffer
  2852. @ref-start-item M-.
  2853. enter-and-go-tags-buffer, prompt for tag and go to tagged
  2854. position (open buffer, if needed)
  2855.  
  2856. filename-or-tag-completion can also be used. In this case, the
  2857. first tag starting with the given text is used.
  2858. @ref-end-item
  2859.  
  2860. ;OCL{{{  @tags-mac-ref Tags file
  2861. ;OCL}}}
  2862. ;OCL}}}
  2863. ;OCL{{{  find-and-go-tags-buffer
  2864. @ref-start-item M-,
  2865. find-and-go-tags-buffer, like enter-and-go-tags-buffer, but use
  2866. the word under the cursor
  2867. @ref-end-item
  2868.  
  2869. ;OCL{{{  @tags-mac-ref Tags file
  2870. ;OCL}}}
  2871. ;OCL}}}
  2872. ;OCL{{{  set-user-tags-file
  2873. @ref-start-item C-X t
  2874. set-user-tags-file, define a new tags file (empty input uses
  2875. default tags files).
  2876. @ref-end-item
  2877.  
  2878. ;OCL{{{  @tags-mac-ref Tags file
  2879. ;OCL}}}
  2880. ;OCL}}}
  2881. ;OCL}}}
  2882. ;OCL{{{  Macros
  2883. ;OCL{{{  start-define-macro
  2884. @ref-start-item C-X "(
  2885. define-macro, starts recording a keyboard macro
  2886. @ref-end-item
  2887. ;OCL}}}
  2888. ;OCL{{{  end-define-macro
  2889. @ref-start-item C-X ")
  2890. define-macro, ends recording a keyboard macro
  2891. @ref-end-item
  2892. ;OCL}}}
  2893. ;OCL{{{  execute-macro
  2894. @ref-start-item C-X "e
  2895. execute-macro, executes a recorded keyboard macro
  2896. @ref-end-item
  2897. ;OCL}}}
  2898. ;OCL}}}
  2899.  
  2900. ;OCL{{{  center-and-redraw-display
  2901. @ref-start-item C-L
  2902. center-and-redraw-display, redraws screen bringing the current
  2903. line to the middle of the screen.
  2904. @ref-end-item
  2905. ;OCL}}}
  2906. ;OCL{{{  redraw-display
  2907. @ref-start-item refresh  |  M-C-L
  2908. redraw, redraws screen e.g. after write(1)s from other people
  2909. etc.
  2910. @ref-end-item
  2911. ;OCL}}}
  2912.  
  2913. ;OCL{{{  describe-bindings
  2914. @ref-start-item shift-help  |  C-X "?
  2915. describe-bindings, shows all commands and where they are bound to
  2916. @ref-end-item
  2917. ;OCL}}}
  2918. ;OCL{{{  describe-fold
  2919. @ref-start-item C-X "=
  2920. describe-fold, gives you some information about your position in
  2921. the text
  2922. @ref-end-item
  2923. ;OCL}}}
  2924. ;OCL{{{  quote-character
  2925. @ref-start-item C-Q
  2926. quote-character, simply insert the next character and do not
  2927. parse it as a command
  2928. @ref-end-item
  2929. ;OCL}}}
  2930. ;OCL{{{  filename-or-tag-completion
  2931. @ref-start-item M-C-I
  2932. filename-or-tag-completion, complete a word to a filename. This
  2933. function works everywhere, not only in prompts! If
  2934. filename-or-tag-completion is used outside of prompts and if
  2935. there is no filename to complete, Emacs tries to complete the
  2936. started word as tag.
  2937. @ref-end-item
  2938.  
  2939. ;OCL{{{  @tags-mac-ref Tags file
  2940. ;OCL}}}
  2941. ;OCL}}}
  2942. ;OCL{{{  fill-paragraph
  2943. @ref-start-item M-q
  2944. fill-paragraph, fills paragraph from cursor to end of paragraph
  2945. @ref-end-item
  2946. ;OCL}}}
  2947. ;OCL{{{  set-fill-column
  2948. @ref-start-item C-X "f
  2949. set-fill-column, sets fill column to argument, or cursor position
  2950. if none is given, or asks for it if cursor if at the left margin.
  2951. @ref-end-item
  2952. ;OCL}}}
  2953. ;OCL}}}
  2954. ;OCL{{{  How to get out
  2955. ;OCL{{{  exit-origami
  2956. @ref-start-item exit  |  C-X C-C
  2957. exit-origami
  2958. @ref-end-item
  2959. ;OCL}}}
  2960. ;OCL{{{  save-and-exit-origami
  2961. @ref-start-item shift-exit  |  M-Z
  2962. save-and-exit-origami
  2963. @ref-end-item
  2964. ;OCL}}}
  2965. ;OCL{{{  suspend-origami
  2966. @ref-start-item suspend  |  C-Z
  2967. suspend-origami
  2968. @ref-end-item
  2969. ;OCL}}}
  2970. ;OCL}}}
  2971.  
  2972. ;OCL{{{  Funny Functions
  2973. ;OCL{{{  @ff sokoban
  2974. @ref-start-item M-X k
  2975. ;OCL{{{  sokoban
  2976. ;OCL}}}
  2977. @ref-end-item
  2978. ;OCL}}}
  2979. ;OCL{{{  @ff towers-of-hanoi
  2980. @ref-start-item M-X t
  2981. Play the well known game towers-of-hanoi at the bottom of the current buffer.
  2982. set-argument can be used, to control the height.
  2983. @ref-end-item
  2984. ;OCL}}}
  2985. ;OCL}}}
  2986. ;OCL}}}
  2987. ;OCL}}}
  2988. @end-reference-copy
  2989. ;OCL}}}
  2990. @fi
  2991. ;OCL}}}
  2992.